WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Авторские Темы для WordPress
класс не описан

acf_fields{} ACF 1.0

Хуков нет.

Возвращает

null. Ничего.

Использование

$acf_fields = new acf_fields();
// use class methods

Методы

  1. __construct()
  2. get_field_type( $name )
  3. get_field_types()
  4. is_field_type( $name )
  5. register_field_type( $class )
  6. register_field_type_info( $info )

Код acf_fields{} ACF 5.9.1

<?php
class acf_fields {
	
	/** @var array Contains an array of field type instances */
	var $types = array();
	
	
	/*
	*  __construct
	*
	*  This function will setup the class functionality
	*
	*  @type	function
	*  @date	5/03/2014
	*  @since	5.4.0
	*
	*  @param	n/a
	*  @return	n/a
	*/
	
	function __construct() {
		/* do nothing */
	}
	
	
	/*
	*  register_field_type
	*
	*  This function will register a field type instance
	*
	*  @type	function
	*  @date	6/07/2016
	*  @since	5.4.0
	*
	*  @param	$class (string)
	*  @return	n/a
	*/
	
	function register_field_type( $class ) {
		
		// allow instance
		if( $class instanceOf acf_field ) {
			$this->types[ $class->name ] = $class;
		
		// allow class name
		} else {
			$instance = new $class();
			$this->types[ $instance->name ] = $instance;
		}
	}
	
	
	/*
	*  get_field_type
	*
	*  This function will return a field type instance
	*
	*  @type	function
	*  @date	6/07/2016
	*  @since	5.4.0
	*
	*  @param	$name (string)
	*  @return	(mixed)
	*/
	
	function get_field_type( $name ) {
		return isset( $this->types[$name] ) ? $this->types[$name] : null;
	}
	
	
	/*
	*  is_field_type
	*
	*  This function will return true if a field type exists
	*
	*  @type	function
	*  @date	6/07/2016
	*  @since	5.4.0
	*
	*  @param	$name (string)
	*  @return	(mixed)
	*/
	
	function is_field_type( $name ) {
		return isset( $this->types[$name] );
	}
	
	
	/*
	*  register_field_type_info
	*
	*  This function will store a basic array of info about the field type
	*  to later be overriden by the above register_field_type function
	*
	*  @type	function
	*  @date	29/5/17
	*  @since	5.6.0
	*
	*  @param	$info (array)
	*  @return	n/a
	*/
	
	function register_field_type_info( $info ) {
		
		// convert to object
		$instance = (object) $info;
		$this->types[ $instance->name ] = $instance;
	}	
	
	
	/*
	*  get_field_types
	*
	*  This function will return an array of all field types
	*
	*  @type	function
	*  @date	6/07/2016
	*  @since	5.4.0
	*
	*  @param	$name (string)
	*  @return	(mixed)
	*/
	
	function get_field_types() {
		return $this->types;
	}
}