• Resolved Diegossc

    (@diegossc)


    Hi there!

    I have this function to show some contents only to loged users:
    add_shortcode( ‘miembro’, ‘shortcode_para_miembros’ );
    function shortcode_para_miembros( $atts, $content = null ) {
    if ( is_user_logged_in() && !is_null( $content ) && !is_feed() )
    return $content;
    return ”;
    }

    The problem is when i use this filter on the front end, the shortcode for [wppb-login] or [wppb-edit-profile] doesn´t work, and shown as shortcode in the front-end Example:

    [miembro] Form for loged users: [wppb-edit-profile] [/miembro]

    When i put this in the front end i still get the shortcode instead of the profile form.

    Can u help me?
    Regards!

    https://wordpress.org/plugins/profile-builder/

Viewing 1 replies (of 1 total)
  • Plugin Author adispiac

    (@adispiac)

    Hi Diego,
    It’s not working because you need to wrap the content with do_shortcode() like below:

    add_shortcode( 'miembro', 'shortcode_para_miembros');
    function shortcode_para_miembros( $atts, $content = '' ) {
        if ( is_user_logged_in() && !is_null( $content ) && !is_feed() )
            return do_shortcode($content);
        return '';
    }

    Another option would be to use Eyes Only plugin in conjunction with PB.

    On the edit profile page you should have something like this:

    [eyesonly logged="in"]
    [wppb-edit-profile]
    [/eyesonly]

    I’ve tested both options and they should work. Can you confirm?

Viewing 1 replies (of 1 total)

The topic ‘Problem with conditional’ is closed to new replies.