content_pagination filter-hookWP 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.

Usage

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.

Changelog

Since 4.4.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.