shortcode( $args, $url ); } return $embed ? $embed : __( 'Embed HTML not available.', 'meta-box' ); } /** * Get field HTML * * @param mixed $meta * @param array $field * @return string */ public static function html( $meta, $field ) { $attributes = self::get_attributes( $field, $meta ); return sprintf( ' %s
%s
', self::render_attributes( $attributes ), __( 'Preview', 'meta-box' ), $meta ? self::get_embed( $meta ) : '' ); } /** * Output the field value * Display embed media * * @param array $field Field parameters * @param array $args Additional arguments. Not used for these fields. * @param int|null $post_id Post ID. null for current post. Optional. * * @return mixed Field value */ public static function the_value( $field, $args = array(), $post_id = null ) { $value = self::get_value( $field, $args, $post_id ); $output = ''; if ( empty( $value ) ) { return $output; } if ( $field['clone'] ) { $output = ''; } else { $output = self::get_embed( $value ); } return $output; } }