acf_field::__construct
Initializes the acf_field class. To initialize a field type that is extending this class, use the initialize() method in the child class instead.
Метод класса: acf_field{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$acf_field = new acf_field(); $acf_field->__construct();
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field::__construct() acf field:: construct ACF 6.4.2
public function __construct() {
// Initialize the field type.
$this->initialize();
// Register info about the field type.
acf_register_field_type_info(
array(
'label' => $this->label,
'name' => $this->name,
'category' => $this->category,
'description' => $this->description,
'doc_url' => $this->doc_url,
'tutorial_url' => $this->tutorial_url,
'preview_image' => $this->preview_image,
'pro' => $this->pro,
'public' => $this->public,
)
);
// value
$this->add_field_filter( 'acf/load_value', array( $this, 'load_value' ), 10, 3 );
$this->add_field_filter( 'acf/update_value', array( $this, 'update_value' ), 10, 3 );
$this->add_field_filter( 'acf/format_value', array( $this, 'format_value' ), 10, 4 );
$this->add_field_filter( 'acf/validate_value', array( $this, 'validate_value' ), 10, 4 );
$this->add_field_action( 'acf/delete_value', array( $this, 'delete_value' ), 10, 3 );
// field
$this->add_field_filter( 'acf/validate_rest_value', array( $this, 'validate_rest_value' ), 10, 3 );
$this->add_field_filter( 'acf/validate_field', array( $this, 'validate_field' ), 10, 1 );
$this->add_field_filter( 'acf/load_field', array( $this, 'load_field' ), 10, 1 );
$this->add_field_filter( 'acf/update_field', array( $this, 'update_field' ), 10, 1 );
$this->add_field_filter( 'acf/duplicate_field', array( $this, 'duplicate_field' ), 10, 1 );
$this->add_field_action( 'acf/delete_field', array( $this, 'delete_field' ), 10, 1 );
$this->add_field_action( 'acf/render_field', array( $this, 'render_field' ), 9, 1 );
$this->add_field_action( 'acf/render_field_settings', array( $this, 'render_field_settings' ), 9, 1 );
$this->add_field_filter( 'acf/prepare_field', array( $this, 'prepare_field' ), 10, 1 );
$this->add_field_filter( 'acf/translate_field', array( $this, 'translate_field' ), 10, 1 );
// input actions
$this->add_action( 'acf/input/admin_enqueue_scripts', array( $this, 'input_admin_enqueue_scripts' ), 10, 0 );
$this->add_action( 'acf/input/admin_head', array( $this, 'input_admin_head' ), 10, 0 );
$this->add_action( 'acf/input/form_data', array( $this, 'input_form_data' ), 10, 1 );
$this->add_filter( 'acf/input/admin_l10n', array( $this, 'input_admin_l10n' ), 10, 1 );
$this->add_action( 'acf/input/admin_footer', array( $this, 'input_admin_footer' ), 10, 1 );
// field group actions
$this->add_action( 'acf/field_group/admin_enqueue_scripts', array( $this, 'field_group_admin_enqueue_scripts' ), 10, 0 );
$this->add_action( 'acf/field_group/admin_head', array( $this, 'field_group_admin_head' ), 10, 0 );
$this->add_action( 'acf/field_group/admin_footer', array( $this, 'field_group_admin_footer' ), 10, 0 );
// Add field global settings configurable by supports on specific field types.
$this->add_field_action( 'acf/field_group/render_field_settings_tab/validation', array( $this, 'render_required_setting' ), 5 );
$this->add_field_action( 'acf/field_group/render_field_settings_tab/presentation', array( $this, 'render_bindings_setting' ), 5 );
foreach ( acf_get_combined_field_type_settings_tabs() as $tab_key => $tab_label ) {
$this->add_field_action( "acf/field_group/render_field_settings_tab/{$tab_key}", array( $this, "render_field_{$tab_key}_settings" ), 9, 1 );
}
}