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
786                     }
787                     /**
788                      * Filter the HTML output of individual page number links.
789                      *
790                      * @since 3.6.0
791                      *
792                      * @param string $link The page number HTML output.
793                      * @param int    $i    Page number for paginated posts' page links.
794                      */
795                     $link = apply_filters( 'wp_link_pages_link', $link, $i );
796
797                     // Use the custom links separator beginning with the second link.
798                     $output .= ( 1 === $i ) ? ' ' : $r['separator'];
799                     $output .= $link;
800                }
801                $output .= $r['after'];
802           } elseif ( $more ) {
803                $output .= $r['before'];
804                $prev = $page - 1;
805                if ( $prev ) {
806                     $link = _wp_link_page( $prev ) . $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . '</a>';
807
808                     /** This filter is documented in wp-includes/post-template.php */
809                     $output .= apply_filters( 'wp_link_pages_link', $link, $prev );
810                }
811                $next = $page + 1;
812                if ( $next <= $numpages ) {
813                     if ( $prev ) {
814                          $output .= $r['separator'];
815                     }
816                     $link = _wp_link_page( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>';
817
818                     /** This filter is documented in wp-includes/post-template.php */
819                     $output .= apply_filters( 'wp_link_pages_link', $link, $next );
820                }
821                $output .= $r['after'];
822           }
823      }
824
825      /**
826       * Filter the HTML output of page links for paginated posts.
827       *
828       * @since 3.6.0