gde_profile_to_profile

Make new profile (from existing).

Description

gde_profile_to_profile( $sourceid, (string) $name, (string) $desc = '' ); 

Parameters (3)

0. $sourceid
The sourceid.
1. $name (string)
The name.
2. $desc — Optional. (string) => ''
The desc.

Usage

  1. if ( !function_exists( 'gde_profile_to_profile' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/functions-admin.php'; 
  3.  
  4. // The sourceid. 
  5. $sourceid = null; 
  6.  
  7. // The name. 
  8. $name = ''; 
  9.  
  10. // The desc. 
  11. $desc = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = gde_profile_to_profile($sourceid, $name, $desc); 
  15.  

Defined (1)

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

/functions-admin.php  
  1. function gde_profile_to_profile( $sourceid, $name, $desc = '' ) { 
  2. global $wpdb; 
  3. $table = $wpdb->prefix . 'gde_profiles'; 
  4.  
  5. if ( $sourcedata = $wpdb->get_row( $wpdb->prepare( "SELECT profile_data FROM $table WHERE profile_id = %d", $sourceid ), ARRAY_A ) ) { 
  6. $newprofile = array( $name, $desc, $sourcedata['profile_data'] ); 
  7. if ( gde_write_profile( $newprofile ) > 0 ) { 
  8. return true; 
  9. } else { 
  10. return false; 
  11. } else { 
  12. return false;