WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
image field in profile (1 post)

  1. somtam
    Member
    Posted 1 year 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!

    http://wordpress.org/extend/plugins/advanced-custom-fields/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic