If you want to use your code, try this:
If you want to check if the medias are attachments, you can try to use $_REQUEST['detached']
add_action( 'load-upload.php', 'export_media_test' );
function export_media_test() {
if ( ! isset( $_REQUEST['action'] ) )
return;
echo 'Export Media';
if ( isset( $_REQUEST['detached'] ) ) {
die( 'No attachments' );
} else {
die( 'Attachments' );
}
exit();
}
You can not check an nonce that wasn’t set. The nonce bulk-posts
is set in edit.php
, and this is the the posts list. In upload.php
is the bulk-media
nonce set. So use check_admin_referer('bulk-media');
Related Posts:
- How to remove admin menu pages inserted by plugins?
- Making Custom Fields Standard in the Admin UI
- Custom ReCaptcha Login
- Creating my own Admin Forms in a WordPress CMS?
- Is there a plugin to make attaching images easier?
- Removing fields from the Media Uploader/Gallery
- deleted users still show in count?
- How to build custom WP admin with custom URLs
- Redirect members to custom page upon logging in through WP admin
- where can i add custom script to stop header video from autoplay
- Retrieving and Storing Images Linked from Other Domains on Local Server?
- Custom Dashboard Home Screen Options
- Add a page that appears in the backend admin that lists files to download? WP 3.3
- Adding “Interesting Tags” & “Ignored Tags” like StackOverflow.com in a WordPress Blog?
- How do I go straight to “Edit More Details” when clicking on an item in the media library?
- How do I change the default admin color scheme in MP6
- How to re-arrange media uploaded using : media_handle_upload() as per year / month
- Customizing default Mediaelement player
- Extend Screen Options
- Admin Panel – Custom Menu Sub-Item LINK
- Adding custom styles to dropdown in editor
- how to add custom css and js on wordpress post editor directly without using .php file
- How to customize core admin pages within a theme?
- Allow non-admins to access the Customize theme page
- How to change popular term checklist title when edit post?
- WordPress customizer Preview not loading
- Get Image from Media Library with the Title
- WordPress media uploader – upload tabs not hiding
- How to use default WP form elements to interact with custom DB table?
- Extend WordPress Core Classes in OOP Theme?
- Customizing Users in Admin Area
- Custom Columns WordPress Admin
- Restrict Viewing of post on both front and backend?
- add custom content to appearance/widgets screen
- theme customizer – can a single option pass multiple values?
- How to remove admin menu pages inserted by plugins and themes in the top admin bar?
- Customizing admin look and feel for just one particular type of user
- Open login logo URL in new tab
- Change admin_title of a plugin using code snippet/functions
- Can’t upload format files on media library
- Delete a column in edit.php generated with a plugin
- Add admin page for specific post status (for example)
- How to show Term ID beside Name Category with wp_dropdown_categories()
- How to create custom backend admin menu in different languages?
- Create “blank” admin page without having admin-bar/admin-menu for faster load
- POST 429 Error when trying to place more than 20 images into post at once
- Figuring out how to create “Option Pages” in WordPress admin
- Check get_post value after wp-admin login
- Custom Admin Section
- where can i find the login page in wordpress and add my header to it
- Style Radio Buttons inside Edit Page (Custom Fields)
- Is there a way to limit multi upload in media upload box?
- Changing a setting in the wp-admin/customize.php reverts CSS styles to parent theme [closed]
- Custom Link In WordPress Media “Attachment Details” Upload Screen
- Customizing the built-in Media Playlist
- Create Custom Admin Fields
- How can I add a Description column to the media library browser screen?
- Upload files in wordpress
- How to create functions that affect only a specific user
- Prevent posts from being published if the ‘Uncategorized’-category or no category is selected
- Custom Search on media files PDF images pages posts
- How can I get the Media Library backend to show larger thumbnails?
- Import bootstrap 5 and bootstrap icons in wp-admin backend
- WordPress Responsive Custom Control WP Customizer
- How to: Easily Move a WordPress Install from Development to Production?
- Organizing Code in your WordPress Theme's functions.php File?
- Is there a flowchart for WordPress loading sequence?
- Essential technical features for high-end WordPress web hosting? [closed]
- How to put logs in WordPress
- How to get the Date Format and Time Format settings for use in my template?
- Where are Additional CSS files stored
- How do i best handle custom plugin page actions?
- Best Practices for Regression Testing WordPress Websites?
- Remove wrapping div and ul from output of wp_nav_menu
- What Is The Use Of map_meta_cap Filter?
- get post author id outside loop
- Custom Walker: how to get ID in function start_lvl
- Creative uses of WordPress [closed]
- How to *remove* a parent theme page template from a child theme?
- How do I make my child theme re-apply the settings that were customised when its parent was active?
- Multiple Inputs in a Customizer Control
- New WP_Customize API – how does it work under the hood?
- Embedding a SOAP Client into a WordPress Plugin?
- Is there anything that Joomla or Drupal can do that can’t be done in WordPress? [closed]
- Update widget form after drag-and-drop (WP save bug)
- Data sanitization: Best Practices with code examples
- How to benchmark a WordPress installation? [closed]
- Should I delete the default themes?
- Moving WP install from local to live, what about wp_posts GUID?
- Modified wp.media.view.Settings.Gallery in Backbone JS, but editing doesn’t work
- Running Gutenberg React in Development Mode
- Prevent WordPress from automatically installing a new theme each year
- Can we use one WordPress installation for multiple databases, domains and content directories
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Plugin SVN & update API – how are plugins identified?
- Users with custom roles not showing in post author select box
- How to use more than 256MB of memory in the admin?
- Cleanup uploads folder, Media Library db structure
- How do register_sidebar() and get_sidebar() work together?
- How do you get formatted content of a post using the WordPress API?