media_send_to_editor( string $html )

In this article

Adds image HTML to editor.

Parameters

$htmlstringrequired

Source

function media_send_to_editor( $html ) {
	?>
	<script type="text/javascript">
	var win = window.dialogArguments || opener || parent || top;
	win.send_to_editor( <?php echo wp_json_encode( $html ); ?> );
	</script>
	<?php
	exit;
}

Changelog

VersionDescription
2.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.