pop_get_recent_posts_args

Description

The “pop_get_recent_posts_args” filter is used to modify the arguments used to retrieve the most recent posts.

A plugin (or theme) can modify the object with the code:

<?php add_filter( 'pop_get_recent_posts_args', 'filter_function_name'); ?>

The hook is located in the popular-widget/_inc/functions.php file.

Example

// Apply filter
function modify_pop_get_recent_posts_args( $args ) {
$args['order'] = 'DESC';
return $args;
}
add_filter('pop_get_recent_posts_args', 'modify_pop_get_recent_posts_args');

Note: $args is an associative array that must match the values used by get_posts().


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *