gde_profile_to_profile
Make new profile (from existing).
Description
Parameters (3)
- 0. $sourceid
- The sourceid.
- 1. $name (string)
- The name.
- 2. $desc — Optional. (string) =>
''
- The desc.
Usage
if ( !function_exists( 'gde_profile_to_profile' ) ) { require_once '/functions-admin.php'; } // The sourceid. $sourceid = null; // The name. $name = ''; // The desc. $desc = ''; // NOTICE! Understand what this does before running. $result = gde_profile_to_profile($sourceid, $name, $desc);
Defined (1)
The function is defined in the following location(s).
- /functions-admin.php
- function gde_profile_to_profile( $sourceid, $name, $desc = '' ) {
- global $wpdb;
- $table = $wpdb->prefix . 'gde_profiles';
- if ( $sourcedata = $wpdb->get_row( $wpdb->prepare( "SELECT profile_data FROM $table WHERE profile_id = %d", $sourceid ), ARRAY_A ) ) {
- $newprofile = array( $name, $desc, $sourcedata['profile_data'] );
- if ( gde_write_profile( $newprofile ) > 0 ) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }