• This is a follow-up to https://www.ads-software.com/support/topic/removing-message-with-private-content/

    As people have pointed out there, removing the message “You don’t have permission to access this content” is not possible.

    I did some digging and found out that this is because in the function get_restriction_message of the file class-wppcp-private-content.php in line 535, the code is if ($message != '') {.

    Specifying the message=”” in any shortcode will result in $message becoming ''. Consequently, the line ($message != '') evaluates to false and we jump to the else-bracket. There, the default message will be displayed.

    Workaround 1: Use a non-empty message when using the shortcode (maybe message=” ” (i.e. a blank space) will work, but I doubt it).

    Workaround 2: Change the default message by adding a filter to wppcp_content_restricted_default_message.

    Fix (for the devoloper of this plugin): I suggest tracking in some other way if no message has been specified. Maybe using null will work, or maybe another parameter for the PHP-functions or the shortcode is needed.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Removing message with private content’ is closed to new replies.