acf_field_oembed::render_field()
Create the HTML interface for your field
Метод класса: acf_field_oembed{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$acf_field_oembed = new acf_field_oembed(); $acf_field_oembed->render_field( $field );
- $field (обязательный)
- -
Список изменений
С версии 3.6 | Введена. |
Код acf_field_oembed::render_field() acf field oembed::render field ACF 6.0.4
<?php function render_field( $field ) { // atts $atts = array( 'class' => 'acf-oembed', ); // <strong><?php _e("Error.", 'acf'); </strong> _e("No embed found for the given URL.", 'acf'); // value if ( $field['value'] ) { $atts['class'] .= ' has-value'; } ?> <div <?php echo acf_esc_attrs( $atts ); ?>> <?php acf_hidden_input( array( 'class' => 'input-value', 'name' => $field['name'], 'value' => $field['value'], ) ); ?> <div class="title"> <?php acf_text_input( array( 'class' => 'input-search', 'value' => $field['value'], 'placeholder' => __( 'Enter URL', 'acf' ), 'autocomplete' => 'off', ) ); ?> <div class="acf-actions -hover"> <a data-name="clear-button" href="#" class="acf-icon -cancel grey"></a> </div> </div> <div class="canvas"> <div class="canvas-media"> <?php if ( $field['value'] ) { echo $this->wp_oembed_get( $field['value'], $field['width'], $field['height'] ); } ?> </div> <i class="acf-icon -picture hide-if-value"></i> </div> </div> <?php }