Skip to content

Instantly share code, notes, and snippets.

@wp-seopress
Last active October 28, 2024 09:39
Show Gist options
  • Save wp-seopress/b1ea52ad3e2c2f946fd4a78d55eda595 to your computer and use it in GitHub Desktop.
Save wp-seopress/b1ea52ad3e2c2f946fd4a78d55eda595 to your computer and use it in GitHub Desktop.
Filter the query of the Site Audit feature
<?php
add_filter('seopress_site_audit_query', 'sp_site_audit_query', 10, 5);
function sp_site_audit_query($args, $batch_size, $offset, $cpt, $cpt_status) {
//Pass your WP Query arguments to the $args array
//default values
$args = [
'posts_per_page' => $batch_size,
'offset' => (int)$offset,
'post_type' => $cpt,
'post_status' => $cpt_status,
'fields' => 'ids'
];
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment