acf_field_oembed::initialize
This function will setup the field type data
Метод класса: acf_field_oembed{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$acf_field_oembed = new acf_field_oembed(); $acf_field_oembed->initialize();
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field_oembed::initialize() acf field oembed::initialize ACF 6.4.2
function initialize() {
// vars
$this->name = 'oembed';
$this->label = __( 'oEmbed', 'acf' );
$this->category = 'content';
$this->description = __( 'An interactive component for embedding videos, images, tweets, audio and other content by making use of the native WordPress oEmbed functionality.', 'acf' );
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-oembed.png';
$this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/oembed/', 'docs', 'field-type-selection' );
$this->defaults = array(
'width' => '',
'height' => '',
);
$this->width = 640;
$this->height = 390;
$this->supports = array(
'escaping_html' => true, // The OEmbed field only produces html safe content from format_value.
);
// extra
add_action( 'wp_ajax_acf/fields/oembed/search', array( $this, 'ajax_query' ) );
add_action( 'wp_ajax_nopriv_acf/fields/oembed/search', array( $this, 'ajax_query' ) );
}