Change WordPress user roles and capabilities Forums How to or FAQ Block Content View Restrictions on Categories and Tags for Editor role

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8214
    Mike
    Participant

    Hi Vladimir, any idea?

    #8226
    Vladimir
    Keymaster

    Thank you for this bug report.
    Quick fix: open user-role-editor-pro/pro/includes/classes/content-view-restrictions.php file, go to line #89 and insert this code:

    if ( !current_user_can( self::VIEW_POSTS_ACCESS_CAP ) ) {
    return false;
    }

    The resulting version should be:

    public function do_on_init() {

    $this->plugins_compatibility();

    if ( !current_user_can( self::VIEW_POSTS_ACCESS_CAP ) ) {
    return false;
    }

    // Do not move to action executed earlier!
    // WooCommerce registers its taxonomies using 'init' action. So we should execute code only after it
    $taxonomies = get_taxonomies(
    array('public'=>true,
    'show_ui'=>true),
    'names');
    foreach( $taxonomies as $taxonomy ) {
    add_action( "{$taxonomy}_edit_form", array('URE_Content_View_Restrictions_Editor', 'render_term_box') );
    add_action( "edited_{$taxonomy}", array('URE_Content_View_Restrictions_Editor', 'save_term_meta_data') );
    }

    }
    // end of add_init_hooks()

    I included this fix to the coming version update.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.