Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/09/2021 06:10:51 PM (3 years ago)
Author:
imath
Message:

Admin: improve information about WP pages being used as BP directories

We are now using BuddyPress specific post states to inform a WordPress page is used as the BP Component's directory page. This information is displayed into the WP Admin Pages edit screen, for menu items linking to a BP Directory into the WP Admin Menu screen as well as into the Customizer Menu section.

Fixes #8470

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-component.php

    r13093 r13123  
    547547        parent::blocks_init( $blocks );
    548548    }
     549
     550    /**
     551     * Add the Activity directory state.
     552     *
     553     * @since 10.0.0
     554     *
     555     * @param array   $states Optional. See BP_Component::admin_directory_states() for description.
     556     * @param WP_Post $post   Optional. See BP_Component::admin_directory_states() for description.
     557     * @return array          See BP_Component::admin_directory_states() for description.
     558     */
     559    public function admin_directory_states( $states = array(), $post = null ) {
     560        $bp = buddypress();
     561
     562        if ( isset( $bp->pages->activity->id ) && (int) $bp->pages->activity->id === (int) $post->ID ) {
     563            $states['page_for_activity_directory'] = _x( 'BP Activity Page', 'page label', 'buddypress' );
     564        }
     565
     566        return parent::admin_directory_states( $states, $post );
     567    }
    549568}
Note: See TracChangeset for help on using the changeset viewer.