pll_copy_taxonomies

Filter the taxonomies to copy or synchronize.

Description

apply_filters( 'pll_copy_taxonomies', (array) $taxonomies, (bool) $sync, (int) $from, (int) $to, (string) $lang ); 

Parameters (5)

0. $taxonomies (array)
List of taxonomy names
1. $sync (bool)
True if it is synchronization, false if it is a copy
2. $from (int)
Id of the post from which we copy informations
3. $to (int)
Id of the post to which we paste informations
4. $lang (string)
Language slug

Usage

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

Defined (1)

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

/modules/sync/admin-sync.php  
  1. return array_unique( apply_filters( 'pll_copy_taxonomies', $taxonomies, $sync, $from, $to, $lang ) );