content_pagination хук-фильтрWP 4.4.0

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 Введена.

Где вызывается хук

WP_Query::generate_postdata()
content_pagination
wp-includes/class-wp-query.php 4731
$pages = apply_filters( 'content_pagination', $pages, $post );

Где используется хук в WordPress

Использование не найдено.