Nombre del gancho
seopress_video_regeneration_total_count_posts, seopress_video_regeneration_increment, seopress_video_regeneration_query
Versión requerida
7.2
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); |