Title: manolo13's Replies | WordPress.org

---

# manolo13

  [  ](https://wordpress.org/support/users/manolo13/)

 *   [Profile](https://wordpress.org/support/users/manolo13/)
 *   [Topics Started](https://wordpress.org/support/users/manolo13/topics/)
 *   [Replies Created](https://wordpress.org/support/users/manolo13/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/manolo13/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/manolo13/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/manolo13/engagements/)
 *   [Favorites](https://wordpress.org/support/users/manolo13/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Category Color] Where to insert the code?](https://wordpress.org/support/topic/where-to-insert-the-code-1/)
 *  [manolo13](https://wordpress.org/support/users/manolo13/)
 * (@manolo13)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/where-to-insert-the-code-1/#post-5822673)
 * Hi Zayed!
 * That’s a wonderfull plugin. I sent you a message (zayedbaloch(at)gmail.com) regarding
   the code.
 * Trying to figure out whre should i place it. Would appreciate your help.
 * Thanks in advance.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Frontier Post] about featured image](https://wordpress.org/support/topic/about-featured-image-2/)
 *  Thread Starter [manolo13](https://wordpress.org/support/users/manolo13/)
 * (@manolo13)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/about-featured-image-2/#post-5994895)
 * ok, this is an update!
 * DISREGARD THE ABOVE CODE!
    works fine, but admin cannot see the whole library
   either!!!
 * so this is the right code
 *     ```
       function my_files_only( $wp_query ) {
           if ($wp_query->query_vars['post_type']=="attachment"){
               if ( !current_user_can( 'level_5' ) ) {
                   global $current_user;
                   $wp_query->set( 'author', $current_user->id );
               }
           }
       }
   
       add_filter('parse_query', 'my_files_only' );
       ```
   
 * still looking for the featured image thing…
 * any help much appreciated!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Frontier Post] about featured image](https://wordpress.org/support/topic/about-featured-image-2/)
 *  Thread Starter [manolo13](https://wordpress.org/support/users/manolo13/)
 * (@manolo13)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/about-featured-image-2/#post-5994892)
 * Ok, i managed to restrict access to the whole media library when user uses the“
   add media” button (he can see only his files)
 * here is the code, inserted in functions.php
 *     ```
       add_action('pre_get_posts','ml_restrict_media_library');
       function ml_restrict_media_library( $wp_query_obj ) {
   
       global $current_user, $pagenow;
   
       if( !is_a( $current_user, 'WP_User') )
   
       return;
   
       if( 'admin-ajax.php' != $pagenow || $_REQUEST['action'] != 'query-attachments' )
   
       return;
   
       if( !current_user_can('manage_media_library') )
   
       $wp_query_obj->set('author', $current_user->ID );
   
       return;
   
       }
       ```
   
 * I am still trying to figure out how this can be done with “select featured image”.
 * Any help?
 * Also, how can i replace text “select featured image” with a button?
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Frontier Post] about featured image](https://wordpress.org/support/topic/about-featured-image-2/)
 *  Thread Starter [manolo13](https://wordpress.org/support/users/manolo13/)
 * (@manolo13)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/about-featured-image-2/#post-5994825)
 * Hey finnj! Thanks for your prompt answer.
 * I am currently using the simple visual editor. What is the name of the template?
   Old, simple or standard?
 * One more question.
 * Is there a way to restrict access to the whole media library when user uploading
   a feature image? I mean upload a featured image directly from pc only?
 * Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)