Buddypress Support

#28557
  • Resolved Kaan Çalışkan
    Rank Math free

    Hello
    I use the buddypress. I need a show custom meta title and desctiption.

    Title: %username% – %fullname%
    Desctiption: “who is username, where %username% lives, %username% contact information”.

    Is this possible?

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    You can use following filter code to register new variables:

    
    add_action( 'rank_math/vars/register_extra_replacements', function(){
    	rank_math_register_var_replacement(
    		'username',
    		[
    			'name'        => esc_html__( 'Custom variable name.', 'rank-math' ),
    			'description' => esc_html__( 'Custom variable description.', 'rank-math' ),
    			'variable'    => 'username',
    			'example'     => 'get_buddypress_username()',
    		],
    		'get_buddypress_username()'
    	);
    });
    
    function get_buddypress_username() {
    	return 'User Name';
    }
    

    Add this code in your theme’s functions.php file and you’ll see the username variable in the dropdown.

    I hope that helps. Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Buddypress Support’ is closed to new replies.