wp_link_pages_link
Filters the HTML output of individual page number links.
Description
Parameters (2)
- 0. $link (string)
- The page number HTML output.
- 1. $i (int)
- Page number for paginated posts' page links.
Usage
- To run the hook, copy the example below.
- $link = apply_filters( 'wp_link_pages_link', $link, $i );
- if ( !empty( $link ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_link_pages_link callback
- function filter_wp_link_pages_link( $link, $i ) {
- // make filter magic happen here...
- return $link;
- };
- // add the filter
- add_filter( 'wp_link_pages_link', 'filter_wp_link_pages_link', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'wp_link_pages_link', 'filter_wp_link_pages_link', 10, 2 );
Defined (3)
The filter is defined in the following location(s).
- /wp-includes/post-template.php
- $link = apply_filters( 'wp_link_pages_link', $link, $i );
- $output .= apply_filters( 'wp_link_pages_link', $link, $prev );
- $output .= apply_filters( 'wp_link_pages_link', $link, $next );