Created
November 9, 2023 15:46
-
-
Save wp-seopress/6699f2d9ad6d65903870b1f80c28cfa0 to your computer and use it in GitHub Desktop.
Filter the video XML sitemap regeneration tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sp_video_regeneration_total_count_posts($sql) { | |
global $wpdb; | |
$sql = (int) $wpdb->get_var("SELECT count(*) FROM {$wpdb->posts} WHERE post_status IN ('pending', 'draft', 'publish', 'future') AND post_type IN ( 'your_cpt_name' ) "); | |
return $sql; | |
} | |
add_filter('seopress_video_regeneration_total_count_posts', 'sp_video_regeneration_total_count_posts'); | |
function sp_video_regeneration_increment($increment) { | |
//default: 1 | |
$increment = 10; | |
return $increment; | |
} | |
add_filter('seopress_video_regeneration_increment', 'sp_video_regeneration_increment'); | |
function sp_video_regeneration_query($args, $increment, $cpt, $offset) { | |
//default | |
$args = [ | |
'posts_per_page' => $increment, | |
'post_type' => $cpt, | |
'post_status' => ['pending', 'draft', 'publish', 'future'], | |
'offset' => $offset, | |
]; | |
return $args; | |
} | |
add_filter('seopress_video_regeneration_query', 'sp_video_regeneration_query', 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment