display-posts-shortcode icon indicating copy to clipboard operation
display-posts-shortcode copied to clipboard

Add filter `display_posts_shortcode_query_results`

Open billerickson opened this issue 1 year ago • 0 comments

See: https://wordpress.org/support/topic/display-10-most-recent-posts-but-sort-asc-oldest-to-newest/

While I was able to alter the query results using the posts_results filter, this applies to all queries on the site and required multiple steps to get Display Posts attributes accessible there.

It would be better to have our own filter for modifying the query results. Ex: change this line to:

	$dps_listing = new WP_Query( apply_filters( 'display_posts_shortcode_args', $args, $original_atts ) );
	$dps_listing = apply_filters( 'display_posts_shortcode_query_results', $dps_listing, $original_atts );

billerickson avatar May 10 '24 20:05 billerickson