do_action( 'media_buttons', string $editor_id )
Fires after the default media button(s) are displayed.
Description Description
Parameters Parameters
- $editor_id
-
(string) Unique editor identifier, e.g. 'content'.
Source Source
Changelog Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
/** * Example of how you can add your own custom media * button in WordPress editor */ function add_media_button() { printf( '<a href="%s" class="button my-button my-custom-button" id="my-custom-button">' . '<span class="wp-media-buttons-icon dashicons dashicons-art"></span> %s' . '</a>', '#', __( 'My Custom Button', 'textdomain' ) ); } add_action( 'media_buttons', 'add_media_button' );