Current User link shortcode Profile Builder Pro

[php]/*
* Profile Builder Pro: Current User link shortcode
* Use like so: [current_user_link] This is displayed only if current user is logged in.
*/

add_shortcode( ‚current_user_link‘, ‚wppbc_current_user_link‘ );
function wppbc_current_user_link( $atts, $content ) {
if ( is_user_logged_in() ) {
$id = get_current_user_id();

if ( ICL_LANGUAGE_CODE == ‚de‘ ){
$ausstellerprofiltext = ‚Online-Ausstellerprofil‘;
} else {
$ausstellerprofiltext = ‚online exhibitor profile‘;
}
// make sure to change the URL to represent your setup.
return „“ . $ausstellerprofiltext . „„;
}

return ;
}[/php]

War dieser Artikel hilfreich?
Nach oben scrollen