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 |
---|---|
1951 | $n = 0; |
1952 | $dots = false; |
1953 |
|
1954 | if ( $prev_next && $current && 1 < $current ) : |
1955 | $link = str_replace('%_%', 2 == $current ? '' : $format, $base); |
1956 | $link = str_replace('%#%', $current - 1, $link); |
1957 | if ( $add_args ) |
1958 | $link = add_query_arg( $add_args, $link ); |
1959 | $link .= $add_fragment; |
1960 | $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>'; |
1961 | endif; |
1962 | for ( $n = 1; $n <= $total; $n++ ) : |
1963 | $n_display = number_format_i18n($n); |
1964 | if ( $n == $current ) : |
1965 | $page_links[] = "<span class='page-numbers current'>$n_display</span>"; |
1966 | $dots = true; |
1967 | else : |
1968 | if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : |
1969 | $link = str_replace('%_%', 1 == $n ? '' : $format, $base); |
1970 | $link = str_replace('%#%', $n, $link); |
1971 | if ( $add_args ) |
1972 | $link = add_query_arg( $add_args, $link ); |
1973 | $link .= $add_fragment; |
1974 | $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>"; |
1975 | $dots = true; |
1976 | elseif ( $dots && !$show_all ) : |
1977 | $page_links[] = '<span class="page-numbers dots">' . __( '…' ) . '</span>'; |
1978 | $dots = false; |
1979 | endif; |
1980 | endif; |
1981 | endfor; |
1982 | if ( $prev_next && $current && ( $current < $total || -1 == $total ) ) : |
1983 | $link = str_replace('%_%', $format, $base); |
1984 | $link = str_replace('%#%', $current + 1, $link); |
1985 | if ( $add_args ) |
1986 | $link = add_query_arg( $add_args, $link ); |
1987 | $link .= $add_fragment; |
1988 | $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>'; |
1989 | endif; |
1990 | switch ( $type ) : |
1991 | case 'array' : |
1992 | return $page_links; |
1993 | break; |
1994 | case 'list' : |
1995 | $r .= "<ul class='page-numbers'>\n\t<li>"; |
1996 | $r .= join("</li>\n\t<li>", $page_links); |
1997 | $r .= "</li>\n</ul>\n"; |