• Resolved 84wb

    (@84wb)


    Hello Joachim,

    I started configuring RUA as I was looking for a tool to restrict access to certain pages based on preferences in the WordPress User database. RUA does that perfectly.

    My problem is that I can neither use categories nor tags to restrict access and am therefore limited to selecting specific files from the dropdown in RUA setting which is rather awkward.

    Is it possible to add a custom field to each page/post and refer to that within RUA? Could not find any trigger to this in the current UI.

    This would help a lot. As I am a bit behind schedule 😉 I would love to hear back soon. 🙂

    Best, Bernhard

Viewing 1 replies (of 1 total)
  • Plugin Author Joachim Jensen

    (@intoxstudio)

    Hi,

    Developers can add and remove their own conditions, but there is currently no documentation for it.

    You might want to check out how conditions are implemented by looking here: \restrict-user-access\lib\wp-content-aware-engine\module\author.php

    The most important functions in the class is:
    in_context: how do we know this condition should be considered for this page/post?
    get_context_data: when we know this, how do we get the data for this condition (in your case, the custom field)
    _get_content: how do we get the selectable custom fields for the admin UI?

    Then you can add it like this:

    add_action('init',function() {
        WPCACore::modules()->add(new Module_Class,'module_id');
    });

    The class will automatically be displayed as a condition in the admin UI afterwards.

    Otherwise, do you just want to restrict a lot of posts/page without selecting each one? If yes, would it be doable by adding a resriction on content written by select authors?

Viewing 1 replies (of 1 total)

The topic ‘Custom field’ is closed to new replies.