Advanced Custom Fields
image field in profile (1 post)

  1. somtam
    Posted 3 years ago #

    I use the hook pre_get_posts with this code, that let the author see, from the media overlay, only the images that the owner uploaded.

    add_action('pre_get_posts', 'my_filter_posts_list');
    function my_filter_posts_list($query) {
       if ( isset( $_REQUEST['action'] ) ){
            if( 'admin-ajax.php' == $pagenow || $_REQUEST['action'] == 'query-attachments' ){
                 $query->set('author', $current_user->ID);

    but since I do that, the image field I insert into the profile page didn't show up anymore :(
    Only for admin is still there!
    thanks so much for helping!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic