Support

Account

Home Forums Backend Issues (wp-admin) Limit results in filter post_object query Reply To: Limit results in filter post_object query

  • I have a similar is issue when trying to do this:

    function my_post_object_query( $args, $field, $post )
    {
        // filter by the posts current categories
        $args['cat'] = implode(",", wp_get_post_categories($post->ID));
    	echo "<pre>";
    	print_r($args);	
    	echo "<pre>";
    	return $args;
    	
    }
    
    add_filter('acf/fields/post_object/query/key=field_524f02159316d', 'my_post_object_query', 10, 3);

    The category filter is not picked up… same as above, the post_object.php is using get_pages() against a custom post type.

    Suggestions other then changing the core file?