Change WordPress user roles and capabilities Forums How to or FAQ Set Posts to manage at User level but by an ACF setting Reply To: Set Posts to manage at User level but by an ACF setting

#6713
Vladimir
Keymaster

Erik,

I moved get_posts() out of filter function and saved its result inside global variable. So filter function looks now as:


function ure_edit_posts_access_set_id_list_cu($list) {
	global $ag_posts_list;
	
	if ( empty( $ag_posts_list ) ) {
		return $list;
	}
	
	if ( empty( $list ) ) {
		return $ag_posts_list;
	}
	
	$list .= ', '. $ag_posts_list;
	
	return $list;

I created successfully new page ‘Test 124’ under user with ‘Program Editor’.
Make your own test and let me know the result.