WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
Metabox not visible for non admins (3 posts)

  1. Wills1971
    Member
    Posted 1 year ago #

    Hello,

    I'm using this code in functions.php to show posts in admin backend only from author currently logged in:

    function posts_for_current_author($query) {
    	global $user_level;
    	if($query->is_admin && $user_level < 3) {
    		global $user_ID;
    		$query->set('author',  $user_ID);
    		unset($user_ID);
    	}
    	unset($user_level);
    	return $query;
    }
    add_filter('pre_get_posts', 'posts_for_current_author');

    From version 3.3.9 ACF metabox is not visible any more for contributors.

    Is there any other solution except to remove this code from my theme functions.php

    Thanks!

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

  2. Wills1971
    Member
    Posted 1 year ago #

    The same question was asked here:
    http://support.advancedcustomfields.com/discussion/3075/custom-type-and-custom-user/p1
    but without any solution except to remove code from functions.php

    ACF 3.3.8 works well with the code in functions.php

    Any ideas?

    Thanks

  3. Wills1971
    Member
    Posted 1 year ago #

    Ok,
    I switched to Custom field suite and everything works great!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.