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
833                     }
834                     /**
835                      * Filter the HTML output of individual page number links.
836                      *
837                      * @since 3.6.0
838                      *
839                      * @param string $link The page number HTML output.
840                      * @param int    $i    Page number for paginated posts' page links.
841                      */
842                     $link = apply_filters( 'wp_link_pages_link', $link, $i );
843
844                     // Use the custom links separator beginning with the second link.
845                     $output .= ( 1 === $i ) ? ' ' : $r['separator'];
846                     $output .= $link;
847                }
848                $output .= $r['after'];
849           } elseif ( $more ) {
850                $output .= $r['before'];
851                $prev = $page - 1;
852                if ( $prev ) {
853                     $link = _wp_link_page( $prev ) . $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . '</a>';
854
855                     /** This filter is documented in wp-includes/post-template.php */
856                     $output .= apply_filters( 'wp_link_pages_link', $link, $prev );
857                }
858                $next = $page + 1;
859                if ( $next <= $numpages ) {
860                     if ( $prev ) {
861                          $output .= $r['separator'];
862                     }
863                     $link = _wp_link_page( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>';
864
865                     /** This filter is documented in wp-includes/post-template.php */
866                     $output .= apply_filters( 'wp_link_pages_link', $link, $next );
867                }
868                $output .= $r['after'];
869           }
870      }
871
872      /**
873       * Filter the HTML output of page links for paginated posts.
874       *
875       * @since 3.6.0