You can try adding a query var using the ‘query_vars’ filter like so:
add_filter('query_vars', 'my_plugin_query_vars');
function my_plugin_query_vars($vars) {
$vars[] = 'login';
return $vars;
}
That may populate $wp_query->query_vars, if not I have successfully used the get_query_var function in one of my projects, try something like:
function my_plugin_display() {
if(get_query_var('login')) {
include( ABSPATH . '/wp-login.php' );
exit;
}
}
Related Posts:
- Creating two database tables via plugin
- Query Posts by Custom Field ‘Price’
- When can you get current page ID and initialize hooks right after?
- Customizing subject in comment notification e-mails
- How to save the values of checkbox to the register setting?
- Edit plugin without hooks in functions.php
- How to get Login Error messages on a custom template
- Using the ‘draft_to_publish’ hook (post status transition)
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Which hook should be used to validate custom form fields on the login form?
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Find out if request is for custom post type archive before query runs
- Pass A Value From Outside To A Plugin Variable
- Built in admin ajax hooks?
- Failed to invoke other hook from the init hook
- How can I add a custom meta value on file upload?
- Adding dynamic section to WordPress
- How can I filter blog name?
- Fatal error: Class not found in
- Is it possible to add an action to the currently running action?
- Showing Notifications While Activating Plugin
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- Determine plugin name from within plugin_action_links filter
- How to prevent action in ajax request, when in admin side?
- merging an array to an existing array using add_filter
- template_redirect not being called when using ajax
- Placement of Code in Plugin for hooking `save_post`
- publish_post plugin hook doesn’t always pass $post->post_content
- What are the benefit in adding hook in the init() hook?
- How use %like% in sql statement wordpress
- add_action in functions.php, do_action in plugin?
- How to correctly detect accessing wp-content/uploads?
- Accessing GET variable named ‘error’
- add action for displaying posts using a shortcode
- WP_Query ordering numbers as letters
- ‘wp_login’ action hook not working with wp-login.php file
- Remove rewrite rules generated by plugin during deactivation
- How to pull code snippet from functionality plugin?
- Where (or when) should I register a new taxonomy?
- Any hook for pre-plugin-update -either bulk or single plugin update
- switched from query_posts to WP_query, not working now?
- AJAX search posts and pages
- How to get all of the activate_plugin action parameters?
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- Get Time Taken By Each Action Hook in WordPress
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- how to use in custom single.php template using php?
- do_action() hook into load-(page)
- How to create a custom shortcode based on the layout?
- Howto check version of another plugin and then add a submenu page to it
- Redirect to another page using contact form 7? [closed]
- Hook for page Request?
- Custom Login Page — wp_signon Headers Already Sent?
- How do I add $_SESSION[”] to my wordpress page?
- Save user total active time after login in wordpress [closed]
- wp_loaded with static Singleton
- is it possible to hook every page style?
- Quick press publish post hook
- using wp_footer hook in a plugin
- Delete data from custom table when deleting a post
- How to deactivate my plugin upon deactivation of NextGen
- How to automatically activate users after registration without activation email?
- Creating a plugin that will display text on every page
- Activation flow of a plugin in a multisite environment
- Add hook after content without formatting
- force logged in user to stay in the dashboard
- How to Join wp_posts & wp_postmeta table using custom query
- admin_post hook not firing function inside class
- The function called on the wp head hook becomes null
- adding dynamic/multiple slug values in ‘option_none_value’
- When/where would want to attach other classes to the base class in a WordPress plugin?
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Passing function into add_action always returns the first argument
- Hook to display element as product on category page
- How to use information from the database in the front-end?
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- plugin not hooking to my custom hook
- wp_login_form() ignoring login_form action hook
- How to insert variable which contain array value in wp_options table?
- Shortcode in a blog post, footer and related products stop working
- Redirect default login page to a custom page [duplicate]
- Plugin hook breaks new WP 4.0 media library grid view?
- Plugin Hook: Get posts
- Display_rows() and column_cb() strange behaviour
- How to create and use Custom hooks
- WP-Snap too slow (caused by WP_Query?)
- WordPress Meta Query: Relation is not working correctly
- Making a Custom Post Type Publish Loop
- How wordpress plugin hooks works? [duplicate]
- Post curl function save twice using plugin hook function wordpress
- WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
- How to create a custom wordpress plugin for a specific functionality?
- Suitable hook when creating, updating and deleting posts programmatically
- Why is my activator class adding the files/running the actions I add?
- is_user_logged_in() undefined at shutdown in plugin context
- Accessing Correct Database to Create REST API Endpoint
- Force file download on plugin activation
- Allow members to create groups on my site