• Appears that version 1.0.4 has disabled the ability for my shortcode within the Global Blocked Message section.

    I have [my-login-form] so that it shows a login form when trying to view blocked content.

    Since 1.0.4, it shows [my-login-form] and not the login form.

    Is there a way for this to work again or is there a different way to show a login on blocked pages.

    Thanks in advance

    https://www.ads-software.com/plugins/user-specific-content/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter chumtarou

    (@chumtarou)

    Just to be more clear, I have my own shortcode for a login form in Functions called [my-login-form]. I had put this into the Global Blocked Message section.

    However, since 1.0.4 the ability for shortcodes in this section stopped working.

    Thread Starter chumtarou

    (@chumtarou)

    Sorry to ask again:

    Is there any way to add a shortcode in the Global Blocked Message section.

    My goal is to add a login form on the page someone is trying to access.

    With this shortcode, it allows me to ensure the visitor can fill in their login details and only view that page without seeing WordPress’s backend. They only see the page.

    Example:

    <div id=”loginmessage”><h1>Private page. Authorized access only.</h1>

    [my-login-form]

    In 1.0.3, the short code worked well. In 1.0.4, the shortcode no longer works.

    If there is a better way to do this, could anyone suggest a way to add a login form the the page without being redirected to WP’s backend?

    Thanks everyone

    Thread Starter chumtarou

    (@chumtarou)

    Not sure this will help anyone but here is what I have done:

    1. I have added this to my functions and removed the previous shortcode method.

    add_filter("user_specific_content_blocked","show_login_form");
    function show_login_form(){
        return wp_login_form(array('echo' =>false));
    }

    2. since this method no longer allows me to show a message and only shows the login prompt, I have added other code in the page template to show a welcome message to logged out visitors explaining this page is only visible to authorized users:

    <?php
    if ( is_user_logged_in() ) {
    	echo '<a href="' . wp_logout_url() . '" title="Logout" class="logoutbutton">Logout</a>
    ';
    } else {
    	echo '
    	<h1>message for people that are not logged in here</h1>
    	';
    };
    ?>

    The reason for this is if I added a do_shortcode in the template, it duplicated the login form so I used this method instead.

    chumtarou, I have the same issue.
    Will use your instructions and see if it works.
    Thanks for sharing.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shortcode in Global Blocked Message not working’ is closed to new replies.