Filter hook 'paginate_links'

in WP Core File wp-includes/general-template.php at line 4776

View Source

paginate_links

Filter Hook
Description
Filters the paginated links for the given archive pages.

Hook Information

File Location wp-includes/general-template.php View on GitHub
Hook Type Filter
Line Number 4776

Hook Parameters

Type Name Description
string $link The paginated link URL.

Usage Examples

Basic Usage
<?php
// Hook into paginate_links
add_filter('paginate_links', 'my_custom_filter', 10, 1);

function my_custom_filter($link) {
    // Your custom filtering logic here
    return $link;
}

Source Code Context

wp-includes/general-template.php:4776 - How this hook is used in WordPress core
<?php
4771  		$link .= $args['add_fragment'];
4772  
4773  		$page_links[] = sprintf(
4774  			'<a class="next page-numbers" href="%s">%s</a>',
4775  			/** This filter is documented in wp-includes/general-template.php */
4776  			esc_url( apply_filters( 'paginate_links', $link ) ),
4777  			$args['next_text']
4778  		);
4779  	endif;
4780  
4781  	switch ( $args['type'] ) {

PHP Documentation

<?php
/**
			 * Filters the paginated links for the given archive pages.
			 *
			 * @since 3.0.0
			 *
			 * @param string $link The paginated link URL.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.