Restrict New nav Item access
-
Hello,
What is on way or the correct one to lock a new profile menu ?
When a user access a ‘declaration’, this info is personnal. Only he/she or the admin could see ‘declaration’ menu.
I m still searching for an answer with no luck.
if ( function_exists( 'bp_is_active' ) && is_user_logged_in() ) {
add_action( 'bp_setup_nav', 'dynamus_declaracao_profile_menu_creation' , 1000 /*301*/ );
function dynamus_declaracao_profile_menu_creation() {
global $bp;
bp_core_new_nav_item( array(
'name' => __( 'Declaração', 'buddypress' ),
'slug' => 'my-all-conversations',
'position' => 75,
'screen_function' => 'dynamus_declaracao_link',
'show_for_displayed_user' => true,
'default_subnav_slug' => 'dynamus-declaracao',
'item_css_id' => 'dynamus-declaracao'
) );
}function dynamus_declaracao_title() {
echo 'My Declaracao !';
}function dynamus_declaracao_content() { ?>
<div id="groups-dir-list" class="groups dir-list">
<?php locate_template( array( 'groups/groups-loop.php' ), true ) ?>
</div><!-- #groups-dir-list -->
<?php
}function dynamus_declaracao_link () {
add_action( 'bp_template_title', 'dynamus_declaracao_title' );
add_action( 'bp_template_content', '_content' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}}
Thanks in advance for any tips !
Alberto
WP 4.3.1
BP Latest
- The topic ‘Restrict New nav Item access’ is closed to new replies.