RWMB_Field::get_class_name PHP Method

get_class_name() public static method

Get field class name
public static get_class_name ( array $field ) : string
$field array Field array
return string Field class name
	public static function get_class_name( $field ) {
		$type = self::map_types( $field );
		$type  = str_replace( array( '-', '_' ), ' ', $type );
		$class = 'RWMB_' . ucwords( $type ) . '_Field';
		$class = str_replace( ' ', '_', $class );
		return class_exists( $class ) ? $class : 'RWMB_Input_Field';
	}

Usage Example

Exemplo n.º 1
0
 /**
  * Get field class name. Only for backward compatibility.
  * @param array $field Field array
  * @return string Field class name
  */
 public static function get_class_name($field)
 {
     return RWMB_Field::get_class_name($field);
 }