gde_profile_name_exists
Check for duplicate profile name.
Description
(int) gde_profile_name_exists( (string) $name );
Returns (int)
Profile id of name or -1 if no match
Parameters (1)
- 0. $name (string)
- The name.
Usage
if ( !function_exists( 'gde_profile_name_exists' ) ) { require_once '/functions-admin.php'; } // The name. $name = ''; // NOTICE! Understand what this does before running. $result = gde_profile_name_exists($name);
Defined (1)
The function is defined in the following location(s).
- /functions-admin.php
- function gde_profile_name_exists( $name ) {
- global $wpdb;
- $table = $wpdb->prefix . 'gde_profiles';
- if ( $id = $wpdb->get_row( $wpdb->prepare( "SELECT profile_id FROM $table WHERE profile_name = %s", $name ), ARRAY_A ) ) {
- return (int) $id['profile_id'];
- } else {
- return -1;
- }
- }