BuddyDev

Search

[Resolved] Block button does not respond.

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #48845

    Thank you.
    I see that the issue is with content. The problem is this section of code.

    
    if ( is_user_logged_in() && function_exists( 'bublock_get_button' ) && bp_is_user() && ! bp_is_my_profile() ) {
    		$args = array(
    			'user_id' => bp_displayed_user_id(),
    			'button_class' => 'my-button-class'
    		);
    		echo bublock_get_button( $args ); 	
    	}
    

    It should be

    
    if ( is_user_logged_in() && function_exists( 'bublock_get_button' ) && bp_is_user() && ! bp_is_my_profile() ) {
    		echo bublock_get_button( bp_displayed_user_id() ); 	
    	}
    

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #48846
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #48861

    Hi Carsten,
    You are welcome.
    I am glad that issue is resolved.

    Can you please tell me the question about like plugin?

    Thank you
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #48864

    Hi Brajesh, sorry for not explaining clearly.

    You helped med to hook the Like button to bp_after_member_profile_content hook.

    What was left was to place the function carsten_print_like_button() within the same span class

    I asked ChatGPT and it came up with the solution of calling the function carsten_print_like_button(); // call the like button function inside the span class and adding the function below.

    It’s working, and my question to you was if this was an inappropriate way to add the function, but all is good.

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #48867

    Hi Carsten,
    No problem.
    yes, the code is in correct position and should work fine.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #48868

    Hi Brajesh, thats good to know, thanks for checking up on this.

    Regards
    Carsten

The topic ‘ [Resolved] Block button does not respond.’ is closed to new replies.

This topic is: resolved