wp_get_image_editor

Advertisement

Summery Summery

Returns a WP_Image_Editor instance and loads file into it.

Syntax Syntax

wp_get_image_editor( string $path, array $args = array() )

Parameters Parameters

$path

(string) (Required) Path to the file to load.

$args

(array) (Optional) Additional arguments for retrieving the image editor.

Default value: array()

Return Return

(WP_Image_Editor|WP_Error) The WP_Image_Editor object if successful, an WP_Error object otherwise.

Source Source

File: wp-includes/media.php

			$html .= sprintf( $source, $type['type'], esc_url( $url ) );
		}
	}

	if ( ! empty( $content ) ) {
		if ( false !== strpos( $content, "\n" ) ) {
			$content = str_replace( array( "\r\n", "\n", "\t" ), '', $content );
		}
		$html .= trim( $content );
	}

	if ( 'mediaelement' === $library ) {
		$html .= wp_mediaelement_fallback( $fileurl );
	}
	$html .= '</video>';

	$width_rule = '';
	if ( ! empty( $atts['width'] ) ) {
		$width_rule = sprintf( 'width: %dpx;', $atts['width'] );
	}
	$output = sprintf( '<div style="%s" class="wp-video">%s</div>', $width_rule, $html );

	/**
	 * Filters the output of the video shortcode.
	 *
	 * @since 3.6.0
	 *
	 * @param string $output  Video shortcode HTML output.

Advertisement

Changelog Changelog

Changelog
Version Description
3.5.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.