public function oembed() { echo $this->input(array('class' => 'cmb2-oembed regular-text', 'data-objectid' => $this->field->object_id, 'data-objecttype' => $this->field->object_type)), '<p class="cmb-spinner spinner" style="display:none;"><img src="' . admin_url('/images/wpspin_light.gif') . '" alt="spinner"/></p>', '<div id="', $this->_id('-status'), '" class="cmb2-media-status ui-helper-clearfix embed_wrap">'; if ($meta_value = $this->field->escaped_value()) { echo cmb2_get_oembed(array('url' => $meta_value, 'object_id' => $this->field->object_id, 'object_type' => $this->field->object_type, 'oembed_args' => array('width' => '640'), 'field_id' => $this->_id())); } echo '</div>'; }
public function oembed() { $meta_value = trim($this->field->escaped_value()); $oembed = !empty($meta_value) ? cmb2_get_oembed(array('url' => $this->field->escaped_value(), 'object_id' => $this->field->object_id, 'object_type' => $this->field->object_type, 'oembed_args' => array('width' => '640'), 'field_id' => $this->_id())) : ''; echo $this->input(array('class' => 'cmb2-oembed regular-text', 'data-objectid' => $this->field->object_id, 'data-objecttype' => $this->field->object_type)), '<p class="cmb-spinner spinner" style="display:none;"></p>', '<div id="', $this->_id('-status'), '" class="cmb2-media-status ui-helper-clearfix embed_wrap">', $oembed, '</div>'; }
/** * Outputs the return of cmb2_get_oembed. * @since 2.2.2 * @see cmb2_get_oembed */ function cmb2_do_oembed($args = array()) { echo cmb2_get_oembed($args); }