WordPress.org

Forums

WordPress Access Areas
[resolved] IF restricted access (3 posts)

  1. DigiDocs
    Member
    Posted 1 year ago #

    Is there any way to use an IF parameter.
    For an exampel

    if (RESTRICTED POST) {
    echo 'SOMETHING';

    }
    else {

    (I would like an image of a key to appear on the posts that are restriced to logged in users)

    http://wordpress.org/plugins/wp-access-areas/

  2. podpirate
    Member
    Plugin Author

    Posted 1 year ago #

    Hi DigiDocs,
    as of v1.2.1 (just a couple of miniutes ago) there is an action hook called wpaa_view_restricted_post.

    It gets fired, when a user tries to access a restricted page/post directly via its permalink.

    I also added some css classes prefixed with 'wpaa-' to the post object (the ones returned by get_post_class()), so the shortest way for your key symbol would be some css like this:

    .wpaa-view-restricted:before {
            content: url('key.png');
        }

    cheers,
    jörn

  3. podpirate
    Member
    Plugin Author

    Posted 1 year ago #

    whoops, forgot to close ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Access Areas
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic