Filter hook 'wp_link_pages'

in WP Core File wp-includes/post-template.php at line 1044

View Source

wp_link_pages

Filter Hook
Description
Filters the HTML output of page links for paginated posts.

Hook Information

File Location wp-includes/post-template.php View on GitHub
Hook Type Filter
Line Number 1044

Hook Parameters

Type Name Description
string $output HTML output of paginated posts' page links.
array|string $args An array or query string of arguments. See wp_link_pages() for information on accepted arguments.

Usage Examples

Basic Usage
<?php
// Hook into wp_link_pages
add_filter('wp_link_pages', 'my_custom_filter', 10, 2);

function my_custom_filter($output, $args) {
    // Your custom filtering logic here
    return $output;
}

Source Code Context

wp-includes/post-template.php:1044 - How this hook is used in WordPress core
<?php
1039  	 *
1040  	 * @param string       $output HTML output of paginated posts' page links.
1041  	 * @param array|string $args   An array or query string of arguments. See wp_link_pages()
1042  	 *                             for information on accepted arguments.
1043  	 */
1044  	$html = apply_filters( 'wp_link_pages', $output, $args );
1045  
1046  	if ( $parsed_args['echo'] ) {
1047  		echo $html;
1048  	}
1049  	return $html;

PHP Documentation

<?php
/**
	 * Filters the HTML output of page links for paginated posts.
	 *
	 * @since 3.6.0
	 *
	 * @param string       $output HTML output of paginated posts' page links.
	 * @param array|string $args   An array or query string of arguments. See wp_link_pages()
	 *                             for information on accepted arguments.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/post-template.php
Related Hooks

Related hooks will be displayed here in future updates.