gde_overwrite_profile

Make existing profile data default (overwrite current default).

Description

gde_overwrite_profile( $sourceid ); 

Parameters (1)

0. $sourceid
The sourceid.

Usage

  1. if ( !function_exists( 'gde_overwrite_profile' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/functions-admin.php'; 
  3.  
  4. // The sourceid. 
  5. $sourceid = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gde_overwrite_profile($sourceid); 
  9.  

Defined (1)

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

/functions-admin.php  
  1. function gde_overwrite_profile( $sourceid ) { 
  2. global $wpdb; 
  3. $table = $wpdb->prefix . 'gde_profiles'; 
  4.  
  5. if ( $data = $wpdb->get_row( $wpdb->prepare( "SELECT profile_data FROM $table WHERE profile_id = %d", $sourceid ), ARRAY_A ) ) { 
  6. if ( $wpdb->update ( $table, $data, array( 'profile_id' => 1 ), array( '%s' ) ) ) { 
  7. return true; 
  8. } else { 
  9. return false; 
  10. } else { 
  11. return false;