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
- All Users > User List > Update User Meta Field Inline
- Removing customise fields during plugin uninstallation
- Globally register styles but enqueue them selectively
- Edit Yoast SEO breadcrumbs output [closed]
- What’s the best way to implement AJAX in WordPress?
- How to Create a Custom Panel and Fields in Post Page [Plugin]
- Translating long texts with html formatting
- Admin Panel pagination link styles
- Is this the right way to execute some PHP in my plugin after a button click on an options page?
- How would I go about creating a user ranked post popularity page?
- How can I force users to a particular subdomain to log in for MU (Multisite)?
- Anonymous Postings
- Display update notification messages like ‘What’s New’
- Do widget options need to be escaped widget()?
- Is there any W3C compatible Share & Follow plugin?
- Does any one have Idea to get these functionalities with the plugin wp-multi-network
- Disable woocommerce cookies and delete cart data automatically
- className not populating in custom block
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Run plugins only on certain pages
- Admin accounts unable to see plugins from external IP
- Overide plugin files from child theme (/inc/ ) folder
- wp_generate_attachment_metadata is creating an empty array
- custom payment gateway in woocommerce failed to connect to remote api server
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Display encrypted content on my website
- Why is WPBakery Page Builder backend editor not clickable? [closed]
- Post category with counts been display like a menu
- Post custom Data value in The Events Calendar plugin [closed]
- Send reply with pre-prepared answers
- Best way to maintain and update 3rd-party WP plugin when developer is unresponsive?
- Plugin dependencies: show notice like theme plugins dependencies
- Save custom attributes of product in woocommerce
- Calling an attribute from a plugin shortcode
- Best place for short bio,image and button [closed]
- WordPress wp-admin/network/plugin-install
- how to access all user dashboard on fronted page [closed]
- Use of Templates in a Plugin
- How to set add question capability for author role in wp pro quiz plugin
- Why can’t I access my Intranet LDAPS with NADI?
- External Domain on WordPress Multisite
- In the archive widget, how do I sort in between two years?
- Customization API for plugin development
- Fromcraft Plugin On click submit button [closed]
- creating a custom shop page display on archive woocommerce
- Visual Composer shortcode for child theme dir
- Setup page on first login on multisite
- polylang + category/tag custom language link
- Anspress Customization: How to show logged in user votes on a single answer?
- Custom wordpress Theme and Plugin repository
- Automatic Updates Individual Plugins Not Working
- How do I make a child theme I made POST through a 3rd party plugin?
- do_action() hook into load-(page)
- How create Group Blogs based on user created Groups
- How to add wp visual editor in a custom widget?
- How to redirect users to their profile after they successfully edit their profile
- Custom table naming/access convention for multisite: $table_prefix vs base_prefix or other?
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)
- How to change the name of the “edit my profile” link in the WordPress admin backend
- WordPress as web application base
- Customize The Events Calendar to Include an Option to Expand for More Events Listings
- URL rewrite of independent plugin?
- Plugin for users to create their own ads like Google Adsence
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- Sync User to cPanel webmail?
- How do I apply style to each category of a list?
- Adding CSS to custom post type admin page causes error
- Add category selection to custom post type (plugin)
- Add custom text color WordPress 3.9 TinyMCE 4 Visual editor
- Redirect to another page using contact form 7? [closed]
- changing posts layout in ultimate member profile plugin
- Display Custom Field Value on Admin Page Column
- How to remove/hide Yoast’s “SEO” tab in admin panel?
- “No Add Button” for me to customize my WordPress with themes and pluggins
- Translation plugin to translate another plugins
- Login Customizer doesn’t change the background of the register form
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- Inserting custom PHP script on homepage
- Add sub menu page in your plugin
- Creating Featured Content Boxes
- What’s causing this error? “Warning: Invalid argument”
- Integrating WP E-commerce plugin into custom theme
- Best practice for including plugin output in a template without using shortcode?
- Custom post types – remove default post supports through empty array?
- Basic gallery plugin suggestion [closed]
- a weird attribute on every html tag
- Move plugin-settings to ‘Settings’-menu in the admin
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- Overriding post’s font-family
- Contact Form 7 – Form name blank [closed]
- WordPress Admin Menu defining function is seperate file