content_pagination
Filters the "pages" derived from splitting the post content.
"Pages" are determined by splitting the post content based on the presence of <!-- nextpage --> tags.
Использование
add_filter( 'content_pagination', 'wp_kama_content_pagination_filter', 10, 2 );
/**
* Function for `content_pagination` filter-hook.
*
* @param string[] $pages Array of "pages" from the post content split by `<!-- nextpage -->` tags.
* @param WP_Post $post Current post object.
*
* @return string[]
*/
function wp_kama_content_pagination_filter( $pages, $post ){
// filter...
return $pages;
}
- $pages(string[])
- Array of "pages" from the post content split by <!-- nextpage --> tags.
- $post(WP_Post)
- Current post object.
Список изменений
| С версии 4.4.0 | Введена. |
Где вызывается хук
content_pagination
wp-includes/class-wp-query.php 4955
$pages = apply_filters( 'content_pagination', $pages, $post );