Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_link_pages_link

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 3 times in this file.

Line Code
964                     }
965                     /**
966                      * Filters the HTML output of individual page number links.
967                      *
968                      * @since 3.6.0
969                      *
970                      * @param string $link The page number HTML output.
971                      * @param int    $i    Page number for paginated posts' page links.
972                      */
973                     $link = apply_filters( 'wp_link_pages_link', $link, $i );
974
975                     // Use the custom links separator beginning with the second link.
976                     $output .= ( 1 === $i ) ? ' ' : $parsed_args['separator'];
977                     $output .= $link;
978                }
979                $output .= $parsed_args['after'];
980           } elseif ( $more ) {
981                $output .= $parsed_args['before'];
982                $prev    = $page - 1;
983                if ( $prev > 0 ) {
984                     $link = _wp_link_page( $prev ) . $parsed_args['link_before'] . $parsed_args['previouspagelink'] . $parsed_args['link_after'] . '</a>';
985
986                     /** This filter is documented in wp-includes/post-template.php */
987                     $output .= apply_filters( 'wp_link_pages_link', $link, $prev );
988                }
989                $next = $page + 1;
990                if ( $next <= $numpages ) {
991                     if ( $prev ) {
992                          $output .= $parsed_args['separator'];
993                     }
994                     $link = _wp_link_page( $next ) . $parsed_args['link_before'] . $parsed_args['nextpagelink'] . $parsed_args['link_after'] . '</a>';
995
996                     /** This filter is documented in wp-includes/post-template.php */
997                     $output .= apply_filters( 'wp_link_pages_link', $link, $next );
998                }
999                $output .= $parsed_args['after'];
1000           }
1001      }
1002
1003      /**
1004       * Filters the HTML output of page links for paginated posts.
1005       *
1006       * @since 3.6.0