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
891                     }
892                     /**
893                      * Filters the HTML output of individual page number links.
894                      *
895                      * @since 3.6.0
896                      *
897                      * @param string $link The page number HTML output.
898                      * @param int    $i    Page number for paginated posts' page links.
899                      */
900                     $link = apply_filters( 'wp_link_pages_link', $link, $i );
901
902                     // Use the custom links separator beginning with the second link.
903                     $output .= ( 1 === $i ) ? ' ' : $r['separator'];
904                     $output .= $link;
905                }
906                $output .= $r['after'];
907           } elseif ( $more ) {
908                $output .= $r['before'];
909                $prev = $page - 1;
910                if ( $prev > 0 ) {
911                     $link = _wp_link_page( $prev ) . $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . '</a>';
912
913                     /** This filter is documented in wp-includes/post-template.php */
914                     $output .= apply_filters( 'wp_link_pages_link', $link, $prev );
915                }
916                $next = $page + 1;
917                if ( $next <= $numpages ) {
918                     if ( $prev ) {
919                          $output .= $r['separator'];
920                     }
921                     $link = _wp_link_page( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>';
922
923                     /** This filter is documented in wp-includes/post-template.php */
924                     $output .= apply_filters( 'wp_link_pages_link', $link, $next );
925                }
926                $output .= $r['after'];
927           }
928      }
929
930      /**
931       * Filters the HTML output of page links for paginated posts.
932       *
933       * @since 3.6.0