Hello, for those who arrived here from Google or other search, the following snippet modification worked for me:
/**
* Filter out current page on UAG Post Grid
*/
function filter_post_query( $query_args, $attributes) {
// Modify $query_args values.
$query_args['post__not_in'][] = get_the_ID();
return $query_args;
print_r($query_args);
}
add_filter( 'uagb_post_query_args_grid', 'filter_post_query', 10, 2 );
According to the debug message, $post__not_in looks for an array, so I added []
after $query_args['post__not_in']
. With this addition, the Post Grid displays the expected items.