Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Checking url from plugin [duplicate]

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:

  1. Creating two database tables via plugin
  2. Query Posts by Custom Field ‘Price’
  3. When can you get current page ID and initialize hooks right after?
  4. Customizing subject in comment notification e-mails
  5. How to save the values of checkbox to the register setting?
  6. Edit plugin without hooks in functions.php
  7. How to get Login Error messages on a custom template
  8. Using the ‘draft_to_publish’ hook (post status transition)
  9. Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
  10. Which hook should be used to validate custom form fields on the login form?
  11. Good tools for locating hooks in a wordpress page/admin interface/blog post?
  12. Find out if request is for custom post type archive before query runs
  13. Pass A Value From Outside To A Plugin Variable
  14. Built in admin ajax hooks?
  15. Failed to invoke other hook from the init hook
  16. How can I add a custom meta value on file upload?
  17. Adding dynamic section to WordPress
  18. How can I filter blog name?
  19. Fatal error: Class not found in
  20. Is it possible to add an action to the currently running action?
  21. Showing Notifications While Activating Plugin
  22. OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
  23. Determine plugin name from within plugin_action_links filter
  24. How to prevent action in ajax request, when in admin side?
  25. merging an array to an existing array using add_filter
  26. template_redirect not being called when using ajax
  27. Placement of Code in Plugin for hooking `save_post`
  28. publish_post plugin hook doesn’t always pass $post->post_content
  29. What are the benefit in adding hook in the init() hook?
  30. How use %like% in sql statement wordpress
  31. add_action in functions.php, do_action in plugin?
  32. How to correctly detect accessing wp-content/uploads?
  33. Accessing GET variable named ‘error’
  34. add action for displaying posts using a shortcode
  35. WP_Query ordering numbers as letters
  36. ‘wp_login’ action hook not working with wp-login.php file
  37. Remove rewrite rules generated by plugin during deactivation‎
  38. How to pull code snippet from functionality plugin?
  39. Where (or when) should I register a new taxonomy?
  40. Any hook for pre-plugin-update -either bulk or single plugin update
  41. switched from query_posts to WP_query, not working now?
  42. AJAX search posts and pages
  43. How to get all of the activate_plugin action parameters?
  44. How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
  45. Using a post-signup hook to get user details
  46. Get Time Taken By Each Action Hook in WordPress
  47. Are functions in main plugin file called before function bound to register_activation_hook runs?
  48. how to use in custom single.php template using php?
  49. do_action() hook into load-(page)
  50. How to create a custom shortcode based on the layout?
  51. Howto check version of another plugin and then add a submenu page to it
  52. Redirect to another page using contact form 7? [closed]
  53. Hook for page Request?
  54. Custom Login Page — wp_signon Headers Already Sent?
  55. How do I add $_SESSION[”] to my wordpress page?
  56. Save user total active time after login in wordpress [closed]
  57. wp_loaded with static Singleton
  58. is it possible to hook every page style?
  59. Quick press publish post hook
  60. using wp_footer hook in a plugin
  61. Delete data from custom table when deleting a post
  62. How to deactivate my plugin upon deactivation of NextGen
  63. How to automatically activate users after registration without activation email?
  64. Creating a plugin that will display text on every page
  65. Activation flow of a plugin in a multisite environment
  66. Add hook after content without formatting
  67. force logged in user to stay in the dashboard
  68. How to Join wp_posts & wp_postmeta table using custom query
  69. admin_post hook not firing function inside class
  70. The function called on the wp head hook becomes null
  71. adding dynamic/multiple slug values in ‘option_none_value’
  72. When/where would want to attach other classes to the base class in a WordPress plugin?
  73. Performance considerations – postmeta table versus new table for custom posts with foreign keys?
  74. Checkbox field that add a subscription product and change prices of other products in checkout and cart page
  75. Passing function into add_action always returns the first argument
  76. Hook to display element as product on category page
  77. How to use information from the database in the front-end?
  78. WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
  79. plugin not hooking to my custom hook
  80. wp_login_form() ignoring login_form action hook
  81. How to insert variable which contain array value in wp_options table?
  82. Shortcode in a blog post, footer and related products stop working
  83. Redirect default login page to a custom page [duplicate]
  84. Plugin hook breaks new WP 4.0 media library grid view?
  85. Plugin Hook: Get posts
  86. Display_rows() and column_cb() strange behaviour
  87. How to create and use Custom hooks
  88. WP-Snap too slow (caused by WP_Query?)
  89. WordPress Meta Query: Relation is not working correctly
  90. Making a Custom Post Type Publish Loop
  91. How wordpress plugin hooks works? [duplicate]
  92. Post curl function save twice using plugin hook function wordpress
  93. WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
  94. How to create a custom wordpress plugin for a specific functionality?
  95. Suitable hook when creating, updating and deleting posts programmatically
  96. Why is my activator class adding the files/running the actions I add?
  97. is_user_logged_in() undefined at shutdown in plugin context
  98. Accessing Correct Database to Create REST API Endpoint
  99. WP_Query does not return the result even if the data is present in the database
  100. Remove H1 title in admin post edit screen
Categories plugins Tags hooks, login, plugin-development, plugins, wp-query
Nav Menu Display
Way to show content of a post, but if exceeds character limit revert to excerpt?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress