add_filter( 'asp_query_args', 'asp_include_only_post_ids', 10, 2 );
function asp_include_only_post_ids( $args, $id ) {
/**
* Enter the post IDs here. The results will be
* limited to these posts/CPT only.
*/
$ids = '1, 2, 3, 4, 5';
$search_ids = 'all'; // Commma separated list of search IDs, if needed
// -- !! Do not change anything below this line !! --
$search_ids = wpd_comma_separated_to_array($search_ids);
if ( in_array('all', $search_ids) || in_array($id, $search_ids) ) {
$ids = wpd_comma_separated_to_array($ids);
if ( is_array($args['post_in']) ) {
$args['post_in'] = array_unique(
array_merge($args['post_in'], $ids)
);
} else {
$args['post_in'] = $ids;
}
}
return $args;
}