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