evolve_change_prefix

The evolve evolve change prefix function.

Description

evolve_change_prefix(); 

Usage

  1. if ( !function_exists( 'evolve_change_prefix' ) ) { 
  2. require_once '/library/functions/basic-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = evolve_change_prefix(); 
  7.  

Defined (1)

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

/library/functions/basic-functions.php  
  1. function evolve_change_prefix() { 
  2. global $wpdb; 
  3.  
  4. $querystr = " SELECT meta_key FROM $wpdb->postmeta WHERE `meta_key` LIKE '%pyre_%' "; 
  5.  
  6. $evolve_meta_key = $wpdb->get_results($querystr); 
  7. foreach ($evolve_meta_key as $meta_key) { 
  8. $original_meta_key = $meta_key->meta_key; 
  9.  
  10. $change_meta_key = str_replace("pyre_", "evolve_", $original_meta_key); 
  11.  
  12. $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = REPLACE(meta_key, '$original_meta_key', '$change_meta_key')");