media_send_to_editor

Adds image html to editor.

Description

media_send_to_editor( (string) $html ); 

Parameters (1)

0. $html (string)
The html.

Usage

  1. if ( !function_exists( 'media_send_to_editor' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/media.php'; 
  3.  
  4. // The html. 
  5. $html = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = media_send_to_editor($html); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/media.php  
  1. function media_send_to_editor($html) { 
  2. ?> 
  3. <script type="text/javascript"> 
  4. var win = window.dialogArguments || opener || parent || top; 
  5. win.send_to_editor( <?php echo wp_json_encode( $html ); ?> ); 
  6. </script> 
  7. <?php 
  8. exit;