Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum/Topic Description: concat custom message


  • robertosalemi
    Participant

    @robertosalemi

    Wordpress 4.0
    bbPress 2.5.4

    Hi,
    in the function ‘bbp_get_single_forum_description’, I would concat a message for user not logged in.

    I wrote:

    add_action( 'bbp_get_single_forum_description', 'msg_for_user_loggedin' );
    add_action( 'bbp_get_single_topic_description', 'msg_for_user_loggedin' );
    
    function msg_for_user_loggedin( $args = '' ) {
    	if ( !bb_is_user_logged_in() )
    	{ 
    		$custom_msg = "You must be logged in to see all topics.";
    	}
    	else 
    	{
    		$custom_msg = "";
    	}
    	
         echo $custom_msg . bbp_get_single_forum_description( $args );
    }

    But it not works, why?

    Thanks.

Viewing 1 replies (of 1 total)

  • robertosalemi
    Participant

    @robertosalemi

    Resolved, I was working with wrong function.

    My solution:

    function add_bbp_display_forum_description_2() {
    
    	$custom_msg = '';
    	
    	if ( !is_user_logged_in() )
    	{ 
    		$custom_msg = 'You must be logged in to see all topics.';
    	}
    	
         echo $custom_msg;
    }
    
    add_action( 'bbp_template_before_single_forum', 'add_bbp_display_forum_description_2' );

    Thanks!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar