acf_field_oembed::initialize
This function will setup the field type data
Method of the class: acf_field_oembed{}
No Hooks.
Returns
null. Nothing (null).
Usage
$acf_field_oembed = new acf_field_oembed(); $acf_field_oembed->initialize();
Changelog
| Since 5.0.0 | Introduced. |
acf_field_oembed::initialize() acf field oembed::initialize code ACF 6.8.8
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' ) );
}