One of the earlier hooks that is aware of the page (I think) is load-{$slug}
:
add_action( 'load-_my-plugin', 'wpse143915_maybe_trigger_export' );
function wpse143915_maybe_trigger_export(){
if( isset( $_GET['export'] ) && ( $_GET['export'] == 'data' ) ){
//...
}
}
If you want to find out what your page slug is, checkout this plug-in by Kaiser: https://github.com/franz-josef-kaiser/current-admin-info
But personally, I wouldn’t bother waiting for the (admin) screen to be initalised. Just send them to admin-post.php?action=myprefix-export
, and then you know when that url is hit:
add_action( 'admin_post_myprefix-export', 'wpse143915_initiate_export' );
function wpse143915_initiate_export(){
//Any security / validation checks
//... export data...
}
Related Posts:
- Update plugin from personal API
- Loading external page template and enqueue script from plugin causes 403 forbidden error
- Symlinked plugin directory doesn’t appear in Admin
- Where the Nickname is being used in WordPress
- WordPress plugin from own server
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- How do I only load a plugin js on it’s settings pages?
- How can I include a setting that has a variable number of values in a settings page using register_setting?
- Adding dynamic section to WordPress
- Use functionality of 2 wordpress plugins
- Custom data-id wp_enqueue_script
- Yoast SEO blocking/re-initialising longer running process
- Add Fields with Sub-Fields to WP Job Manager
- template_redirect not being called when using ajax
- Can WordPress plugins “Talk to each other”?
- How use %like% in sql statement wordpress
- Can I use a form in a dashboard widget?
- Is there a way to alter the order in which the plugins appear in the page?
- How to correctly detect accessing wp-content/uploads?
- How to create custom embed block in gutenberg wordpress
- Plugin exceeds memory limit
- How can sanitize $_FILES[‘haq_slider’] field
- How to trigger $_GET request within admin plugin page?
- MITM risk of not sanitizing?
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- Woocommerce plugin for minimum order and add-to-card-step
- Change plugin main file name (that is currently in the repo)
- Edit Yoast SEO breadcrumbs output [closed]
- Using a post-signup hook to get user details
- How to apply a patch via plugin?
- wp_remote_get() returns 403 while file_get_contents() does not
- How to set add question capability for author role in wp pro quiz plugin
- Suggestions on Approach to New Plugin I’m Stuck On
- Unable to delete custom post types, confusion around capabilities
- Getting wp.me shortlink for wordpress custom post type
- where is the main file in this plugin?
- Insert Array in Plugin Database
- First plugin, problem with get_pages
- plugin wraps the entire content
- Shortcode Attributes to Return different $_POST
- Plugin onclick button activate other plugin
- How programatically cause uploads folder to be created?
- Structuring function with registration_errors hook
- Yoast SEO Plug In and my Theme duplicating code. Need some feedback on what to do? [closed]
- Should I use the action in the plugin’s main file?
- Using Class loader in WordPress boilerplate
- wp_query ‘s’ parameter does not work with WC_AJAX
- Monitor all the queriers executed by my website
- WC Fix Attributes – ‘Add New’ Not Searchable/Delayed
- Allow a particular user to access a particular plugin?
- wordpress plugin add page when activate
- How to dynamically add template in Innerblock?
- Add style to body based on url
- $wpdb->insert not working inside save_post tag
- How to check for already existing plugin versions on activation? and prevent errors
- update_post_meta is not working for me when I use e.preventDefault for update button
- How to create a plugin with automatic update?
- Loading plugin script only on required page?
- Create survey that redirects to sidebar menu customized to answers
- Uploading images to custom table
- Changing author slug for a custom role without using plugin
- Plugin management with my custom plugin
- Plugin Version List not Shown
- How to pass value from WordPress to Javascript
- How do I create a state of “don’t assign anything to variable” if WP_Error throws an error?
- How can I customize Easy Appointment plugin?
- Plugin communication between sites that use it?
- How to change meta data(title, description) for current post?
- how to add custom css at top above all css file for specific url
- Provide http service by wordpress plugin
- Theme editor removes backslashes
- create web service for android app using wordpress website
- Web Application Framework Compatibility with WP Plugin
- Widget Script Loads at Bottom of Page
- Plugin loaded, but not running
- Merge custom plugins in one folder
- Plugin Hook: Get posts
- Why tinyMCE.editors doesnt work on tinyMCE
- Adding custom cron_schedule prior to wp_schedule_event
- Create plugin with form in post and submit it to specific form
- Storing values in Post Meta vs new tables
- Get page type to display content
- Widget redirecting to home page
- Capturing POST data
- Is an Office a custom post type [closed]
- map urls to plugins
- I am using multi image metabox plugin but I did get how to display the images in templete?
- Embed php code in custom field of a plugin [closed]
- How to open author url linked to a new tab in settings page in the WordPress plugin list
- How can I properly sanitize the update_option in WordPress?
- Why is my menu page not being displayed?
- How to add custom html to the Media > Attachment Details modal?
- manage_{taxonomy}_custom_column not working
- Suitable hook when creating, updating and deleting posts programmatically
- How to be Variables and options must be escaped when echo’d?
- How to override plugin function in code snippets WordPress
- How can I gather forums posted by visitors from different sites in one place? [duplicate]
- How to make content as required in custom post type?
- How to create a “Most Popular” & “Latest” TAB in WordPress