Skip to:
Content

BuddyPress.org

Opened 2 months ago

Closed 6 weeks ago

#9224 closed enhancement (fixed)

Introduce a filterable function to inform about whether BP is running from `src`

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 15.0.0 Priority: low
Severity: normal Version:
Component: Core Keywords: has-patch
Cc:

Description

This is a follow up of the patch @emaralive suggested about #9210.

As he commented on the corresponding GH PR, I haven't explained why I decided to not include the part where he was adding a filter to bypass the defined( 'BP_SOURCE_SUBDIRECTORY' ) && BP_SOURCE_SUBDIRECTORY so that testing how the deprecated code is loaded can be achieved using the trunk (development) version of BuddyPress.

To perform this kind of tests as well as whether minified JavaScript are loaded, we already have something in place: testing a build.

We can do: grunt build from the console/terminal and then the /build subdirectory will be generated and BuddyPress will load from there instead of the /src subdirectory. I'd personally advise using this way.

But if you think we should introduce a filter, then I suggest to avoid some code duplication at the same time, introducing the bp_is_running_from_src_subdirectory() filterable function.

Change History (5)

#1 @imath
2 months ago

  • Milestone changed from Awaiting Review to 15.0.0

This ticket was mentioned in PR #358 on buddypress/buddypress by @imath.


2 months ago
#2

  • Keywords has-patch added

bp_is_running_from_src_subdirectory() informs whether BuddyPress was loaded from the src subdirectory (trunk version).

Trac ticket: https://buddypress.trac.wordpress.org/ticket/9224

#3 @espellcaste
7 weeks ago

  • Owner set to imath
  • Status changed from new to assigned

Looks like this one only needs to be commited.

#4 @espellcaste
7 weeks ago

  • Priority changed from normal to low

#5 @imath
6 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 14013:

Introduce a function to inform about whether BP was loaded from src

bp_is_running_from_src_subdirectory() informs whether BuddyPress was loaded from the src subdirectory (trunk version). This function exposes the 'bp_is_running_from_src_subdirectory' to let developers tests code that is only available when BuddyPress is built.

Props emaralive, espellcaste.

See #9210
Fixes #9224
Closes https://github.com/buddypress/buddypress/pull/358

Note: See TracTickets for help on using tickets.