Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/25/2023 05:18:41 PM (2 years ago)
Author:
imath
Message:

Fully deprecate bp_nav & bp_options_nav BP globals

These back compatibility mechanism, which was in BP since version 2.6, has moved to the BP Classic plugin.

Fixes #8927
Closes https://github.com/buddypress/buddypress/pull/121

File:
1 edited

Legend:

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

    r13503 r13507  
    858858    $screen_functions = $bp->{$component}->nav->delete_nav( $slug );
    859859
    860     // Reset backcompat nav items so that subsequent references will be correct.
    861     $bp->bp_nav->reset();
    862     $bp->bp_options_nav->reset();
     860    /**
     861     * Fires when a nav item was removed from navigation.
     862     *
     863     * @since 12.0.0
     864     *
     865     * @param false|callable|array $screen_functions False, the screen function(s) on success.
     866     * @param string               $slug             The slug of the primary navigation item.
     867     * @param string|null          $component        The component the navigation is attached to. Defaults to 'members'.
     868     */
     869    do_action( 'bp_core_removed_nav_item', $screen_functions, $slug, $component );
    863870
    864871    if ( ! is_array( $screen_functions ) ) {
     
    907914    $screen_functions = $bp->{$component}->nav->delete_nav( $slug, $parent_slug );
    908915
    909     // Reset backcompat nav items so that subsequent references will be correct.
    910     $bp->bp_nav->reset();
    911     $bp->bp_options_nav->reset();
     916    /**
     917     * Fires when a subnav item was removed from navigation.
     918     *
     919     * @since 12.0.0
     920     *
     921     * @param false|callable|array $screen_functions False, the screen function(s) on success.
     922     * @param string               $parent_slug The slug of the primary navigation item.
     923     * @param string               $slug        The slug of the secondary item to be removed.
     924     * @param string|null          $component   The component the navigation is attached to. Defaults to 'members'.
     925     */
     926    do_action( 'bp_core_removed_subnav_item', $screen_functions, $parent_slug, $slug, $component );
    912927
    913928    if ( ! is_array( $screen_functions ) ) {
Note: See TracChangeset for help on using the changeset viewer.