acf_field_repeater::initialize
This function will set up the field type data
Метод класса: acf_field_repeater{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$acf_field_repeater = new acf_field_repeater(); $acf_field_repeater->initialize();
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field_repeater::initialize() acf field repeater::initialize ACF 6.4.2
public function initialize() {
$this->name = 'repeater';
$this->label = __( 'Repeater', 'acf' );
$this->category = 'layout';
$this->description = __( 'Provides a solution for repeating content such as slides, team members, and call-to-action tiles, by acting as a parent to a set of subfields which can be repeated again and again.', 'acf' );
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-repeater.png';
$this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/repeater/', 'docs', 'field-type-selection' );
$this->tutorial_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/repeater/how-to-use-the-repeater-field/', 'docs', 'field-type-selection' );
$this->pro = true;
$this->supports = array( 'bindings' => false );
$this->defaults = array(
'sub_fields' => array(),
'min' => 0,
'max' => 0,
'rows_per_page' => 20,
'layout' => 'table',
'button_label' => '',
'collapsed' => '',
);
// field filters
$this->add_field_filter( 'acf/prepare_field_for_export', array( $this, 'prepare_field_for_export' ) );
$this->add_field_filter( 'acf/prepare_field_for_import', array( $this, 'prepare_field_for_import' ) );
// filters
$this->add_filter( 'acf/validate_field', array( $this, 'validate_any_field' ) );
$this->add_filter( 'acf/pre_render_fields', array( $this, 'pre_render_fields' ), 10, 2 );
add_action( 'wp_ajax_acf/ajax/query_repeater', array( $this, 'ajax_get_rows' ) );
}