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 | Owned by: | 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.
bp_is_running_from_src_subdirectory()
informs whether BuddyPress was loaded from thesrc
subdirectory (trunk version).Trac ticket: https://buddypress.trac.wordpress.org/ticket/9224