xprofile_get_field_id_from_name

Returns the ID for the field based on the field name.

Description

(int) xprofile_get_field_id_from_name( (string) $field_name ); 

Returns (int)

$field_id on success, false on failure.

Parameters (1)

0. $field_name (string)
The name of the field to get the ID for.

Usage

  1. if ( !function_exists( 'xprofile_get_field_id_from_name' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-xprofile/bp-xprofile-functions.php'; 
  3.  
  4. // The name of the field to get the ID for. 
  5. $field_name = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = xprofile_get_field_id_from_name($field_name); 
  9.  

Defined (1)

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

/bp-xprofile/bp-xprofile-functions.php  
  1. function xprofile_get_field_id_from_name( $field_name ) { 
  2. return BP_XProfile_Field::get_id_from_name( $field_name );