Run WP functions in bp-custom.php
-
I created a bp-custom.php file inside plugins folder and need to run
count_user_posts()
insidebp_setup_nav
hook. It is possible?add_action( 'bp_setup_nav', function() { global $bp; $post_count = count_user_posts( $bp->displayed_user->id, 'drawings' ); $args = array( 'name' => $post_count, 'slug' => 'drawings', 'default_subnav_slug' => 'drawings', 'position' => 100, 'screen_function' => 'redirect_user_to_author_page' ); bp_core_new_nav_item( $args ); }, 99 );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.