• Resolved theotherdavid

    (@theotherdavid)


    Hi,

    Just wondering if there’s a way to bulk uncheck roles under the Content Permissions box? We basically want to undo it all and allow anyone to view the posts now.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Omar ElHawary

    (@omarelhawary)

    Hi @theotherdavid,

    Thanks for reaching out Members Support Team!

    Please copy/paste PHP snippet below to theme functions.php file and let me know if it helps:

    function reset_members_access_role_permissions() {
    // Query all posts that have the _members_access_role meta key
    $args = array(
    'post_type' => 'any', // If you only want specific post types, adjust this
    'meta_key' => '_members_access_role',
    'posts_per_page' => -1
    );

    $posts = get_posts($args);

    foreach ($posts as $post) {
    // Delete the _members_access_role meta key for each post
    delete_post_meta($post->ID, '_members_access_role');
    }
    }

    // Uncomment the line below to run the function once, and then comment it out after it's done
    //reset_members_access_role_permissions();

    Regards,

    Thread Starter theotherdavid

    (@theotherdavid)

    Omar you’ve done it again –?thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uncheck/Reset in bulk’ is closed to new replies.