Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/31/2024 01:26:36 AM (7 months ago)
Author:
imath
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-rest-api.php

    r13968 r14013  
    3434 */
    3535function bp_rest_in_buddypress() {
    36     $is_src = defined( 'BP_SOURCE_SUBDIRECTORY' ) && BP_SOURCE_SUBDIRECTORY === 'src';
    37 
    38     return ! $is_src && ! bp_rest_is_plugin_active();
     36    return ! bp_is_running_from_src_subdirectory() && ! bp_rest_is_plugin_active();
    3937}
    4038
Note: See TracChangeset for help on using the changeset viewer.