Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 2 years ago

#9224 closed enhancement (fixed)

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

Reported by: imath Owned by: imath
Priority: low Milestone: 15.0.0
Component: Core Version:
Severity: normal 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 years ago

  • Milestone Awaiting Review → 15.0.0

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


2 years 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
2 years ago

  • Owner set to imath
  • Status new → assigned

Looks like this one only needs to be commited.

#4 @espellcaste
2 years ago

  • Priority normal → low

#5 @imath
2 years ago

  • Resolution → fixed
  • Status assigned → 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.