Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Josh Pollock

    (@shelob9)

    What content type are these Pods? If they are custom post types, than you can assign these users the author role. If they are advanced content types, which I assume they are based on this thread than you need to create a custom role and emulate the author capability, but adapt it to the naming convention for Pods roles that Scott outlined in that post.

    Thread Starter weiz

    (@weiz)

    Hello, Josh,

    I tried capabilities mentioned by Scott but it still does not work.
    First, I use Pods Advanced Content Types which I want to make it clear.
    When I add pods_view_{pod} or pods_view_{pod}_others without pods_edit_others or pods_delete_others, nothing happens. The pod can still only be viewed by the author and other authors can’t find it in the overview.

    Then, when I add pods_edit_others or pods_delete_others, the pod can be found by other authors and certainly can be edited or deleted by others, too which is what I want to avoid. So I don’t think view is a useful capability? I also try read, it does not work either.

    I have role with only 2 Capabilities: read and edit_{name of Custom User Capability}. Also add this code in functions.php

    function mypo_parse_query_useronly( $wp_query ) {
        if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) {
            if ( !current_user_can( 'update_core' ) ) {
                global $current_user;
                $wp_query->set( 'author', $current_user->id );
            }
        }
    }
    
    add_filter('parse_query', 'mypo_parse_query_useronly' );

    This code limits The posts screen to only show authors their own posts (code from WPMU DEV)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to enable an author only edit his own pods but can view all in overscreen’ is closed to new replies.