For WP versions before 3.5.0
, use the media_buttons_context
filter:
add_filter( 'media_buttons_context', function($context ) {
global $pagenow;
if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) ) {
$context .= '<a href="#" class="button">Button</a>';
}
return $context;
} );
For 3.5.0+, use the media_buttons
action:
add_action( 'media_buttons', function($editor_id){
echo '<a href="#" class="button">Button</a>';
} );
Both will add a button beside the “Add Media” button above the post editor.
Related Posts:
- Best collection of code for your 'functions.php' file [closed]
- Remove Duplicator plugin from admin menu if not an administrator
- Add a custom form on the post-new.php admin page
- Getting Theme element into plugins page editor in wp admin
- Gathering all Custom Post Type posts in to array/object the proper way
- Echo custom admin field into a is_single()
- Embedding code snippets in posts with indentation
- admin panel save option with ajax
- is_plugin_active function doesn’t exist
- Proper Way to Modify Plugin
- Create tabs inside Plugins Admin Page [closed]
- How to edit a wordpress plugin without break its update process
- Looking for a Table of Contents (TOC) plugin for WordPress
- WordPress Plugin Development In MVC Architecture, How?
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- Where should I use get_option in a plugin
- GPL and plugins
- Disable Specific Widgets on Selected Pages of a WordPress Website?
- Create page when plugin is activated
- Disable text tab on WordPress text-editor
- Custom plugin settings: clicking “save changes” does not display success message
- Integrating plugins in themes
- Posts wont expire
- Themes VS Plugins [duplicate]
- Failed to invoke other hook from the init hook
- Trying to add admin file upload form plugin
- WordPress Plugin Look & Feel
- Multiple plugins using the same OAuth class issues
- How do I future proof my older WordPress theme?
- How to get Plugin Slugs?
- plugin for wp_list_categories with posts
- Advanced Integration – WordPress + YOURLS
- How to add custom style to Gutenberg?
- clean wp_options table unused rows
- Modifying Footnote Plugin for Descriptive Title Attributes
- Will Flutter work with WordPress 3.0?
- How to handle admin and passwords requests from plugins developers?
- Delete Associated Media Upon Page / Post Deletion
- How can I make uploaded images in the editor load with HTTPS?
- How to use get_theme_mod in gutenberg editor wordpress?
- All Users > User List > Update User Meta Field Inline
- Disable woocommerce cookies and delete cart data automatically
- Calling an attribute from a plugin shortcode
- Why can’t I access my Intranet LDAPS with NADI?
- Visual Composer shortcode for child theme dir
- Setup page on first login on multisite
- Sync User to cPanel webmail?
- Adding CSS to custom post type admin page causes error
- Redirect to another page using contact form 7? [closed]
- Display Custom Field Value on Admin Page Column
- How to remove/hide Yoast’s “SEO” tab in admin panel?
- Login Customizer doesn’t change the background of the register form
- Integrating WP E-commerce plugin into custom theme
- Custom post types – remove default post supports through empty array?
- Move plugin-settings to ‘Settings’-menu in the admin
- How do I add some javascript validation to the admin interface form’s onsubmit?
- remove all submenus from plugin
- WordPress as template engine
- creating a plug in that would tap into save/update action of posts [closed]
- When I try to de-activate any plugin it gives error “Warning: call_user_func_array() [function.call-user-func-array]”
- How to see which sites use my installed plugins (wordpress multisite)
- WordPress permissions error with admin account
- Minimize and Uglify WordPress Plugin Files
- How to create plugin in wordpress [closed]
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- I want to filter my products with attributes [closed]
- Problem after updating plugins
- Action on WordPress Install
- Remove specific administrator’s capability
- Delete data from custom table when deleting a post
- How display specific category post to specific users?
- What is the best way to make a custom page from a plugin?
- How to add captcha to publish widget
- Automatic recurring payment using YITH subscription and Dokan Stripe
- How to customize maintenance mode notification in wordpress?
- Hide fields in woocommerce settings
- implement custom roles in custom plugin
- Adding LOAD MORE on a page
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Cron job shedules replace?
- Disable plugin for administrator
- Customize plugin templates
- WordPress delete cookie
- Widget display in theme
- How to use custom footer template in a site-plugin?
- How to get short description under heading – Visual Composer [closed]
- Wordress admin page is fetching error You do not have sufficient permissions to access this page.
- Customize a widget position
- Admin page and admin menu. Permissions plugin
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- Extending the “Add Media”-Dialog … how do I finally insert something to the Post?
- Where to insert customize_register in wordpress plugin
- Create a blank admin page from plugin
- Pronamic Info Window
- WordPress plugins not showing after switching servers
- From a legal perspective, is it okay to customize a plugin’s code?
- Child Plugin Admin Panel
- Need help with restricted page for users
- Does anyone have the Custom Post Permalinks plugin from John P. Bloch? [closed]
- How to disable plugin capability : “create new category”