pll_copy_post_metas

Filter the custom fields to copy or synchronize.

Description

apply_filters( 'pll_copy_post_metas', (unknown) $keys, (bool) $false ); 

Parameters (2)

0. $keys (unknown) => empty( $keys ) ? array() : $keys
The empty.
1. $false (bool) => false )
The false.

Usage

To run the hook, copy the example below.
  1. $keys = apply_filters( 'pll_copy_post_metas', $keys, $false ); 
  2.  
  3. if ( !empty( $keys ) ) { 
  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_post_metas callback 
  2. function filter_pll_copy_post_metas( $keys, $false ) { 
  3. // make filter magic happen here... 
  4. return $keys
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'pll_copy_post_metas', 'filter_pll_copy_post_metas', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'pll_copy_post_metas', 'filter_pll_copy_post_metas', 10, 2 ); 

Defined (2)

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

/modules/wpml/wpml-legacy-api.php  
  1. $arr['fields'] = array_unique( apply_filters( 'pll_copy_post_metas', empty( $keys ) ? array() : $keys, false ) ); 
/modules/sync/admin-sync.php  
  1. $keys = array_unique( apply_filters( 'pll_copy_post_metas', $keys, $sync, $from, $to, $lang ) );