Summery Summery
Adds the media button to the editor
Syntax Syntax
Parameters Parameters
- $editor_id
-
(Optional)
Default value: 'content'
Source Source
File: wp-admin/includes/media.php
?>
</head>
<body<?php echo $body_id_attr; ?> class="wp-core-ui no-js">
<script type="text/javascript">
document.body.className = document.body.className.replace('no-js', 'js');
</script>
<?php
call_user_func_array( $content_func, $args );
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_print_footer_scripts' );
?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
</body>
</html>
<?php
}
/**
* Adds the media button to the editor
*
* @since 2.5.0
*
* @global int $post_ID
*
* @param string $editor_id
*/
function media_buttons( $editor_id = 'content' ) {
static $instance = 0;
$instance++;
$post = get_post();
if ( ! $post && ! empty( $GLOBALS['post_ID'] ) ) {
$post = $GLOBALS['post_ID'];
}
wp_enqueue_media( array( 'post' => $post ) );
$img = '<span class="wp-media-buttons-icon"></span> ';
Advertisement
Changelog Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |