display-posts-shortcode
display-posts-shortcode copied to clipboard
Add filter `display_posts_shortcode_query_results`
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 );