WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 3 times in this file.
Line | Code |
---|---|
2026 | $n = 0; |
2027 | $dots = false; |
2028 |
|
2029 | if ( $prev_next && $current && 1 < $current ) : |
2030 | $link = str_replace('%_%', 2 == $current ? '' : $format, $base); |
2031 | $link = str_replace('%#%', $current - 1, $link); |
2032 | if ( $add_args ) |
2033 | $link = add_query_arg( $add_args, $link ); |
2034 | $link .= $add_fragment; |
2035 | $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>'; |
2036 | endif; |
2037 | for ( $n = 1; $n <= $total; $n++ ) : |
2038 | $n_display = number_format_i18n($n); |
2039 | if ( $n == $current ) : |
2040 | $page_links[] = "<span class='page-numbers current'>$n_display</span>"; |
2041 | $dots = true; |
2042 | else : |
2043 | if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : |
2044 | $link = str_replace('%_%', 1 == $n ? '' : $format, $base); |
2045 | $link = str_replace('%#%', $n, $link); |
2046 | if ( $add_args ) |
2047 | $link = add_query_arg( $add_args, $link ); |
2048 | $link .= $add_fragment; |
2049 | $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>"; |
2050 | $dots = true; |
2051 | elseif ( $dots && !$show_all ) : |
2052 | $page_links[] = '<span class="page-numbers dots">' . __( '…' ) . '</span>'; |
2053 | $dots = false; |
2054 | endif; |
2055 | endif; |
2056 | endfor; |
2057 | if ( $prev_next && $current && ( $current < $total || -1 == $total ) ) : |
2058 | $link = str_replace('%_%', $format, $base); |
2059 | $link = str_replace('%#%', $current + 1, $link); |
2060 | if ( $add_args ) |
2061 | $link = add_query_arg( $add_args, $link ); |
2062 | $link .= $add_fragment; |
2063 | $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>'; |
2064 | endif; |
2065 | switch ( $type ) : |
2066 | case 'array' : |
2067 | return $page_links; |
2068 | break; |
2069 | case 'list' : |
2070 | $r .= "<ul class='page-numbers'>\n\t<li>"; |
2071 | $r .= join("</li>\n\t<li>", $page_links); |
2072 | $r .= "</li>\n</ul>\n"; |