WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Access Manager
Page Access Restriction (2 posts)

  1. mirgcire
    Member
    Posted 4 months ago #

    I am building a language lesson site. The lessons themselves are served up on pages. I would like to restrict access on pages to those who have enrolled in a class.

    So I need to be able to programmatically enable access when they have successfully paid for a class. I looked at the tutorials and found information about manually in/excluding access, but was unable to find anything on programmatic access.

    Can you describe how one might programmatically enable access to page that is restricted?

    Thanks!

    https://wordpress.org/plugins/advanced-access-manager/

  2. WP AAM
    Member
    Plugin Author

    Posted 4 months ago #

    Hi mirgcire,
    It is a good question. Currently we do not have filter that will allow you to do that easily but we can add it on our next release.
    By now we can agree with how to name it.

    So. I believe the best place to add filter is application/control/object/post.php file and function has. This function returns the boolean value true if restriction is applied for post or page.
    We can wrap the $response with apply_filters('aam_post_has', ...

    You can use this filter in your code to dynamically change the return value.
    Let me know what do you think about this solution.

    Regards,
    Vasyl

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.