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 |
|---|---|
| 1991 | $n = 0; |
| 1992 | $dots = false; |
| 1993 | |
| 1994 | if ( $prev_next && $current && 1 < $current ) : |
| 1995 | $link = str_replace('%_%', 2 == $current ? '' : $format, $base); |
| 1996 | $link = str_replace('%#%', $current - 1, $link); |
| 1997 | if ( $add_args ) |
| 1998 | $link = add_query_arg( $add_args, $link ); |
| 1999 | $link .= $add_fragment; |
| 2000 | $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>'; |
| 2001 | endif; |
| 2002 | for ( $n = 1; $n <= $total; $n++ ) : |
| 2003 | $n_display = number_format_i18n($n); |
| 2004 | if ( $n == $current ) : |
| 2005 | $page_links[] = "<span class='page-numbers current'>$n_display</span>"; |
| 2006 | $dots = true; |
| 2007 | else : |
| 2008 | if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : |
| 2009 | $link = str_replace('%_%', 1 == $n ? '' : $format, $base); |
| 2010 | $link = str_replace('%#%', $n, $link); |
| 2011 | if ( $add_args ) |
| 2012 | $link = add_query_arg( $add_args, $link ); |
| 2013 | $link .= $add_fragment; |
| 2014 | $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>"; |
| 2015 | $dots = true; |
| 2016 | elseif ( $dots && !$show_all ) : |
| 2017 | $page_links[] = '<span class="page-numbers dots">...</span>'; |
| 2018 | $dots = false; |
| 2019 | endif; |
| 2020 | endif; |
| 2021 | endfor; |
| 2022 | if ( $prev_next && $current && ( $current < $total || -1 == $total ) ) : |
| 2023 | $link = str_replace('%_%', $format, $base); |
| 2024 | $link = str_replace('%#%', $current + 1, $link); |
| 2025 | if ( $add_args ) |
| 2026 | $link = add_query_arg( $add_args, $link ); |
| 2027 | $link .= $add_fragment; |
| 2028 | $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>'; |
| 2029 | endif; |
| 2030 | switch ( $type ) : |
| 2031 | case 'array' : |
| 2032 | return $page_links; |
| 2033 | break; |
| 2034 | case 'list' : |
| 2035 | $r .= "<ul class='page-numbers'>\n\t<li>"; |
| 2036 | $r .= join("</li>\n\t<li>", $page_links); |
| 2037 | $r .= "</li>\n</ul>\n"; |