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