Convert old meta_key entries in the post meta table into new entries.


do_action( 'pre_aiosp_seometa_meta_key_convert_before', (string) $old, (string) $new, (bool) $delete_old ); 

First check to see what records for $new already exist, storing the corresponding post_id values in an array. When the conversion happens, ignore rows that contain a post_id, to avoid duplicate entries.

Parameters (3)

0. $old (string)
Old meta_key entries.
1. $new (string)
New meta_key entries.
2. $delete_old (bool)
Whether to delete the old entries.


To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'pre_aiosp_seometa_meta_key_convert_before', $old, $new, $delete_old ); 
The following example is for adding a hook callback.
  1. // define the pre_aiosp_seometa_meta_key_convert_before callback 
  2. function action_pre_aiosp_seometa_meta_key_convert_before( $old, $new, $delete_old ) { 
  3. // make action magic happen here... 
  4. }; 
  6. // add the action 
  7. add_action( 'pre_aiosp_seometa_meta_key_convert_before', 'action_pre_aiosp_seometa_meta_key_convert_before', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'pre_aiosp_seometa_meta_key_convert_before', 'action_pre_aiosp_seometa_meta_key_convert_before', 10, 3 ); 

Defined (1)

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

  1. do_action( 'pre_aiosp_seometa_meta_key_convert_before', $old, $new, $delete_old );