Display the social bar of a logged user outside view.php

To use/show the social icons outside view.php you can use the integratable version (with easy API method) here is an example:

echo $this->show_social_bar_clean('user_id');

This is an example already used in bbPress forum integration, you can integrate the social icons bar anywhere you want via the UserPro API function above.

If you want to use a wrapper (custom div wrapping) do it like this:

echo $userpro->show_social_bar_clean( $user_id, 'userpro-icons');

Please remember user_id is dynamic, so you need to adapt it depending on how your user ID is stored (bbpress, buddypress, etc..)

Example :

echo $userpro->show_social_bar_clean(bbp_get_reply_author_id(), 'userpro-icons' );

Was this article helpful?

Related Articles

Leave A Comment?