Hey there i do have a custom function in toolset settings.
The function itself is working great, so there is no Problem.
The Problem is using a toolset shortcode in it.
When i take a look on the front end the shortcode is only visible as words and not the executed code!
Here is my code:
function test_add_button_in_members_loop() {
if ( bp_get_member_user_id() == bp_loggedin_user_id() ) {
return;
}
?>
[wpv-user field="user_email"] //this shortcode shows just the text and not the user email
<div id="block-a-member" class="generic-button">
<a data-balloon-pos="down" data-balloon="TEST" href="/members/" class="block-member">Another Button</a>
</div>
<?php
}
add_action( 'bp_member_members_list_item', 'test_add_button_in_members_loop' );
Hello. Thank you for contacting the Toolset support.
Shortcode needs to rendered first before it gets displyed, what if you try to use the global current user variable.
For example:
function test_add_button_in_members_loop() {
if ( bp_get_member_user_id() == bp_loggedin_user_id() ) {
return;
}
echo do_shortcode('[wpv-user field="user_email"]'); //this shortcode shows just the text and not the user email
?>
<div id="block-a-member" class="generic-button">
<a data-balloon-pos="down" data-balloon="TEST" href="/members/" class="block-member">Another Button</a>
</div>
<?php
}
add_action( 'bp_member_members_list_item', 'test_add_button_in_members_loop' );