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

When the user entered an unauthorized url redirect to login page

I should add is_user_logged_in() wordpress function. and check if user is not logged in site redirect user to home page with wp_redirect(home_url()) function.

 if (isset($query->query_vars['account'])) {

    if (!is_user_logged_in()) {
        wp_redirect(home_url());
        exit();
    }

    include NABRO_USER_PANEL_VIEWS . 'panel.php';
    exit();
}

Related Posts:

  1. How do I make my wordpress page more friendly for mobile viewers?
  2. login to wordpress with Get variables instead of Post
  3. Check javascript file Proper way in functions.php
  4. Should I use RIPS tool to test my themes and plugins?
  5. Workflow and best practice for documentation [closed]
  6. Is there a quick way to inject i18n domain into theme/plugin files?
  7. Translating plugin inside the theme [closed]
  8. Why are some of my thumbnails not being generated?
  9. Include Max mega menu Plugin into theme
  10. wordpress theme backend admin only
  11. How to get current post user id
  12. Different UI in WordPress
  13. The problem with WordPress Importer
  14. Classified ad website : which solutions to use? [closed]
  15. Finding the URL to be used to check if plugin is installed with a theme
  16. How can I position ShareThis buttons manually when using the plug-in? [closed]
  17. How to use get_template part in the plugin?
  18. How do I combine a theme with a plugin
  19. How to write “alt” tag in image for wordpress code?
  20. Use different single.php file based on condition
  21. Theme My Login Shortcode Doesn’t Return Anything
  22. Include Minit plugin in theme [closed]
  23. How can I use my custom wordpress theme on two websites? [closed]
  24. why need theme,if page builder is there in wordpress [closed]
  25. Inserting Plugins Into Blank Space of Externally Designed WordPress Theme
  26. Don’t load the theme for a page FROM a plugin EDITED
  27. Extending a theme: build new features as plugin or core modules?
  28. how to design change in woocommerce cart page and all other page also by theme? [closed]
  29. display unique post per category
  30. How do you create a re-useable HTML fragment in wordpress
  31. Identify current wordpress theme
  32. Removing the custom_image_header from wp_head
  33. Janrain/Simple Modal under Redirected Domain
  34. Elementor Sidebar not loading when PRO elements plugin is active
  35. How to override any plugin file in the child theme
  36. How to get a post views count using ‘WordPress popular posts’ plugin
  37. when i activate my WordPress plugin cannot see customizer options or preview
  38. Showing different js file for different theme in wordpress customizer api
  39. WordPress panel is not loading after plugin activated with error: HTTP ERROR 500
  40. how to add custom css at top above all css file for specific url
  41. How can I add a custom checkbox / radio button on the admin theme options to display a CSS or other?
  42. wp_login_form() ignoring login_form action hook
  43. Why the output of an image gallery plugin is not displayed into a page of my custom theme?
  44. Disqus plugin outputs script as literal text
  45. Breadcrumb is not generating the correct post page url
  46. Site is setup statically – how to make it content managable?
  47. How to work email subscribe in WordPress?
  48. Javascript as Jquery Function Call?
  49. Editing a theme
  50. How to escape html code?
  51. How to create an Info Box on WordPress [closed]
  52. How to make content as required in custom post type?
  53. How to create new title and its description inside a section in WP Customizer?
  54. How to disable CSS rule in Twentythirteen style.css?
  55. Why does my functions.php cause white-screen and media-library issues?
  56. Prevent WordPress installing plugins and themes via Admin
  57. How to make a slideshow shortcode based on the WordPress gallery shortcode? [closed]
  58. how to give a user a role?
  59. Plugin Handle URL With Custom Theme
  60. Globally register styles but enqueue them selectively
  61. How to read individual user’s directory and display content to that specific user?
  62. Guidelines / restrictions about advertising /donate begging unside wordpress plugins or themes
  63. All of my custom posttypes are 404’ing
  64. How can I force users to a particular subdomain to log in for MU (Multisite)?
  65. Plugin: Google Analytics for Dashboard error – Timestamp is too far from current time
  66. Admin Theme customization
  67. “Request has expired” with “Make your site social” (Gigya) plugin
  68. Hooking in to replace the Sidebar/Widget areas
  69. WSOD after upgrading to 3.1
  70. Display post lists in 2nd paragraph
  71. How to save generated JWT token to cookies on login?
  72. Check for security updates
  73. wp_get_post_terms is difference obj model than the one in rest api response
  74. how to add a button next to the wordpress view button?
  75. (FES EDD) New vendor submission page is blank
  76. There is any way to remove post-format filter? [closed]
  77. Plugin-generated pages use Not Found or Pages Archive templates?
  78. Is there any kind of theme on WordPress to sell my own movies?
  79. Create custom registration form for WordPress Multisite
  80. Child Pages Short Code plug-in and hover capabilities?
  81. Linux Permissions and Ownership for WordPress
  82. posts comments goes to trash
  83. WordPress site periodically goes down
  84. Contributive page where people logged in can write
  85. Masonry images not working
  86. Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
  87. Advanced Custom Field DatePicker [closed]
  88. Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()
  89. Best place for short bio,image and button [closed]
  90. What are the specifics of WordPress development I need to know? [closed]
  91. All sites themes functions.php have been changed
  92. Homemade plugin while using Themify Ultra
  93. WordPress shows error related to allow_url_fopen
  94. Why namespaces are rarely used in WordPress plugins?
  95. What will happen if i deactivate my visual composer plug in? [closed]
  96. How to create a code editor for my plugin .?
  97. How to show only next post pagination link using wp_link_pages()
  98. Theme/Plugin installation through url on button click
  99. (Big issue) Blog is Getting Down Each day.. what should i do.?
  100. Custom wordpress Theme and Plugin repository
Categories plugins Tags account, login, plugins, theme-development, themes
Woocommerce price in meta data
How do I use URL to fetch all posts of a particular custom post type?

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