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
- How to benchmark a WordPress installation? [closed]
- Modify existing plugin function using filter (without modifying the plugin directly)
- Why do folders have Empty Index.php Pages?
- global menus made from master site’s custom menus wpmu network
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- Capability to edit own posts and not others
- Is there a way to create invisible pages?
- Which freelance sites are recommended to find WordPress developers/programmers, etc
- Syncing Avatars across multisite
- How to move the wordpress site from test url to main url? [duplicate]
- title, content, feature images
- How can I make site-wide content editable, for example footer content
- Custom Facebook share button with custom title,url,image in wordpress
- Category selectable homepage
- Integrate wordpress into index page
- Missing ‘Move to Trash’ option from bulk select box
- Can I create my own custom Attachment Display Setting?
- How to locate where an element is generated?
- spaces in a text
- How can I add interactive python console to my website? [closed]
- Show “Read more” link only when inserted manually
- Custom select query two tables by a meta key
- How to Add Additional Search Button?
- WordPress pagination with custom post type?
- How to replace blog page url with subdomain at all places, even in xml sitemap?
- Add array of post id’s to a category?
- How to create social Share Buttons Without Plugin
- Saving of Draft is failing
- Custom Avatars for WordPress Comments VIA Website URL?
- Combine Categories & Custom Taxonomy
- Search a meta field for a value in all posts
- Custom image sizes ignored in WP 3.5
- Document.body.scrollTop in WordPress
- Integrate Woocommerce to a custom theme
- Best way to modify theme
- How to move a widget below the menu in a sidebar in twenty thirteen?
- Change in credit card payment button for woocommerce