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 |
|---|---|
| 4019 | $link .= $args['add_fragment']; |
| 4020 | |
| 4021 | /** |
| 4022 | * Filters the paginated links for the given archive pages. |
| 4023 | * |
| 4024 | * @since 3.0.0 |
| 4025 | * |
| 4026 | * @param string $link The paginated link URL. |
| 4027 | */ |
| 4028 | $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $args['prev_text'] . '</a>'; |
| 4029 | endif; |
| 4030 | for ( $n = 1; $n <= $total; $n++ ) : |
| 4031 | if ( $n == $current ) : |
| 4032 | $page_links[] = "<span aria-current='" . esc_attr( $args['aria_current'] ) . "' class='page-numbers current'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '</span>'; |
| 4033 | $dots = true; |
| 4034 | else : |
| 4035 | if ( $args['show_all'] || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : |
| 4036 | $link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] ); |
| 4037 | $link = str_replace( '%#%', $n, $link ); |
| 4038 | if ( $add_args ) { |
| 4039 | $link = add_query_arg( $add_args, $link ); |
| 4040 | } |
| 4041 | $link .= $args['add_fragment']; |
| 4042 | |
| 4043 | /** This filter is documented in wp-includes/general-template.php */ |
| 4044 | $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '</a>'; |
| 4045 | $dots = true; |
| 4046 | elseif ( $dots && ! $args['show_all'] ) : |
| 4047 | $page_links[] = '<span class="page-numbers dots">' . __( '…' ) . '</span>'; |
| 4048 | $dots = false; |
| 4049 | endif; |
| 4050 | endif; |
| 4051 | endfor; |
| 4052 | if ( $args['prev_next'] && $current && $current < $total ) : |
| 4053 | $link = str_replace( '%_%', $args['format'], $args['base'] ); |
| 4054 | $link = str_replace( '%#%', $current + 1, $link ); |
| 4055 | if ( $add_args ) { |
| 4056 | $link = add_query_arg( $add_args, $link ); |
| 4057 | } |
| 4058 | $link .= $args['add_fragment']; |
| 4059 | |
| 4060 | /** This filter is documented in wp-includes/general-template.php */ |
| 4061 | $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $args['next_text'] . '</a>'; |
| 4062 | endif; |
| 4063 | switch ( $args['type'] ) { |
| 4064 | case 'array': |
| 4065 | return $page_links; |
| 4066 | |
| 4067 | case 'list': |
| 4068 | $r .= "<ul class='page-numbers'>\n\t<li>"; |
| 4069 | $r .= join( "</li>\n\t<li>", $page_links ); |
| 4070 | $r .= "</li>\n</ul>\n"; |