• I am creating a custom navigation for members only. I am able to display the navigation buttons using the wa_restricted shortcode. However when users are not logged in, the login button is displayed, and if the user doesn’t have the necessary access rights, they see the following message:
    “You are not authorized to access the requested content.”

    I realize this is useful but we don’t want to display the login button or the message in every single instance of a restricted content block.

    Is there a parameter I can pass to avoid rendering any elements if the user doesn’t have access to the content? or at least is it possible to wrap the message in a tag with a class so it can be hidden via CSS?

Viewing 1 replies (of 1 total)
  • Thread Starter boombalaya

    (@boombalaya)

    Hello. Is this plugin actively maintained? Do you guys accept pull requests? I would like to suggest the addition of a tag in the ContentRestriction module to allow for specificity in CSS manipulation. The text string “You are not authorized to access the requested content.” is not contained within a tag and cannot be referred to via CSS. There are cases in our layout where we do not want this message to be displayed. If it is not possible to prevent this line from rendering, at least we could hide it by targetting its css class.

    Suggestion:

    Modules/ContentRestriction/Module.php – Line 14

    Replace:

    array('accessDeniedMessage' => __('You are not authorized to access the requested content.', WaIntegrationPlugin::TEXT_DOMAIN))

    With

    array('accessDeniedMessage' => '<span class="wa_restricted_contain_message">'.__('You are not authorized to access the requested content.'.'</span>', WaIntegrationPlugin::TEXT_DOMAIN))

    Thank you

    • This reply was modified 4 years, 9 months ago by boombalaya.
Viewing 1 replies (of 1 total)
  • The topic ‘If content is restricted, Show nothing’ is closed to new replies.