Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/09/2021 06:10:51 PM (4 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-groups/classes/class-bp-groups-component.php

    r13103 r13123  
    11351135        );
    11361136    }
     1137
     1138    /**
     1139     * Add the Groups directory states.
     1140     *
     1141     * @since 10.0.0
     1142     *
     1143     * @param array   $states Optional. See BP_Component::admin_directory_states() for description.
     1144     * @param WP_Post $post   Optional. See BP_Component::admin_directory_states() for description.
     1145     * @return array          See BP_Component::admin_directory_states() for description.
     1146     */
     1147    public function admin_directory_states( $states = array(), $post = null ) {
     1148        $bp = buddypress();
     1149
     1150        if ( isset( $bp->pages->groups->id ) && (int) $bp->pages->groups->id === (int) $post->ID ) {
     1151            $states['page_for_groups_directory'] = _x( 'BP Groups Page', 'page label', 'buddypress' );
     1152        }
     1153
     1154        return parent::admin_directory_states( $states, $post );
     1155    }
    11371156}
Note: See TracChangeset for help on using the changeset viewer.