• Resolved xydeown

    (@xydeown)


    Hi , i did like all others put inside function.php :

    function fp_restrict_media($query)
    {
    //Check if it is an admin query
    if ($query->is_admin && !current_user_can( ‘edit_others_posts’ ))
    {
    //Check if it is an attachment query
    if ($query->query[‘post_type’] === ‘attachment’)
    {
    // Get current user, and author=current user to query
    $current_user = wp_get_current_user();
    $query->set(‘author’, $current_user->ID);
    }
    }
    return $query;
    }
    add_filter(‘pre_get_posts’, ‘fp_restrict_media’);

    Now the issue is when i login with subscriber user i can’t see add media button , i don’t have any plugin restirction as i know .
    ANy idea ? thanks .

    Also would be great if you can tell how to limit add posts per user .

    https://www.ads-software.com/plugins/frontier-post/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author finnj

    (@finnj)

    Hi,

    Subscribers and contributors does not have the capability upload_files, you need to make them authors – this is a wordpress limiatation.

    Plugin Author finnj

    (@finnj)

    And you can only limit add user per profile, if you need to limit it per user, you need to have a plugin to manage capabilities per use.

    Try and look at the plugin: User Role Editor.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hi about add media i have issue too’ is closed to new replies.