Support

Account

Home Forums Backend Issues (wp-admin) Attachment Meta Box Disappears Reply To: Attachment Meta Box Disappears

  • Got the very same problem with 4.3.8, but only for other user roles than administrators. I use the following code to achieve that the users can only edit their own posts:

    
    add_action('pre_get_posts', 'query_set_only_author' );
    	function query_set_only_author( $wp_query ) {
    		$screen = get_current_screen();
    
    		if ($screen->base === 'post')
    	    		return $query; // From ACF Support Forum
    
    	    global $current_user;
    	    if( is_admin() && !current_user_can('edit_others_veranstaltungen') ) {
    	        $wp_query->set( 'author', $current_user->ID );
    	        add_filter('views_edit-veranstaltung', 'fix_veranstaltungen_counts');
    	    }
    	}

    Any ideas to fix that problem? I searched the ACF js but it didn’t help me.