pll_add_paged_to_link

Filter an url after the paged part has been added.

Description

apply_filters( 'pll_add_paged_to_link', (string) $user_trailingslashit, (string) $url, (int) $page ); 

Parameters (3)

0. $user_trailingslashit (string) => user_trailingslashit( trailingslashit( $url ) . 'page/' . $page, 'paged' )
The link to the paged page
1. $url (string)
The link to the original first page
2. $page (int)
The page number

Usage

To run the hook, copy the example below.
  1. $user_trailingslashit = apply_filters( 'pll_add_paged_to_link', $user_trailingslashit, $url, $page ); 
  2.  
  3. if ( !empty( $user_trailingslashit ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the pll_add_paged_to_link callback 
  2. function filter_pll_add_paged_to_link( $user_trailingslashit, $url, $page ) { 
  3. // make filter magic happen here... 
  4. return $user_trailingslashit
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'pll_add_paged_to_link', 'filter_pll_add_paged_to_link', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'pll_add_paged_to_link', 'filter_pll_add_paged_to_link', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/include/links-permalinks.php  
  1. return apply_filters( 'pll_add_paged_to_link', user_trailingslashit( trailingslashit( $url ) . 'page/' . $page, 'paged' ), $url, $page );