I have code to get value of buddypress xtended profile :

function get_nickname() {
   echo 'field: ' . xprofile_get_field_data( 3, bp_loggedin_user_id(), 'comma' );
add_action( 'bp_ready', 'get_nickname' );

i need to make a shortcode return nickname or render nickname.

honestly i tried read documentation, but i still dont understand to do that.

how to create buddypress shortcodes?


can you just add_shortcode?

add_shortcode ('use-this', 'get_nickname');

now in your code call [use-this]

of course change 'use-this' to whatever you want in both places if you want to change it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.