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

login

Authentication / login mechanism (non wp-admin)

You can use the wp_loaded hook to push all non-logged-in traffic to the login screen. Note how I’ve passed $_SERVER[‘REQUEST_URI’] to wp_login_url() – this is passed as a URL parameter to the login page, and once a user successfully signs in, they’ll be redirected back to the URL they were originally trying to visit. function … Read more

Categories theme-development Tags authentication, homepage, login, redirect, theme-development

share login/logout sessions across two installs?

You also need to define a matching COOKIEHASH for both sites – a random 32 bit string will do. By default, COOKIEHASH is an MD5 hash of the site URL, and is used to generate the default names for all authentication-related cookies. Hence why, at the moment, your cross-domain login isn’t working (the names of … Read more

Categories multisite Tags login, logout, multisite, session

Users are redirected to homepage instead of wp-admin

Yeeey, I figured it out! Actually my theme had a redirect like this one in functions.php: // Block Access to /wp-admin for non admins. function custom_blockusers_init() { if ( is_user_logged_in() && is_admin() && !current_user_can( ‘administrator’ ) ) { wp_redirect( home_url() ); exit; } } add_action( ‘init’, ‘custom_blockusers_init’ ); // Hook into ‘init’ All you have … Read more

Categories wp-admin Tags login, redirect, wp-admin

How can I include a query string with get_permalink

You can use add_query_arg() to add any query parameters you want to a URI, e.g., $redirect_uri = add_query_arg (‘page’, ‘4’, get_permalink ()) ; $login_uri = wp_login_url ($redirect_uri) ; Or, you could simply use $_SERVER[‘REQUEST_URI’], which will already contain any query string present in the current page’s URI, e.g., $login_uri = wp_login_url ($_SERVER[‘REQUEST_URI’]) ;

Categories permalinks Tags login, permalinks, query-string, redirect

Is it possible to use a forgot password url filter?

Yes it’s also possible for the password, by running a filter on lostpassword_url, which is basically the password equivalent of the login url.. Example Basically the same as before, just changed the function and hook names. add_filter( ‘lostpassword_url’, ‘custom_lostpass_url’ ); function custom_lostpass_url( $lostpassword_url ) { return get_option(‘siteurl’). ‘/lostpass’; }

Categories functions Tags filters, functions, login, password, urls

What is the proper way to apply the login_form_bottom filter?

your code is correct, however, that filter only applies to the wp_login_form() function, which is not what wp-login.php uses, so you won’t be seeing your text there if that’s what you’re expecting! try adding a call to wp_login_form() in a template to see what the filter does.

Categories customization Tags customization, filters, login

My login form does not work

If you read the documentation on wp_login_url, you can specify a redirect URL without having to use that hidden input field. Alternatively, you could just use the wp_login_form function to do exactly what you want: <?php wp_login_form(); ?> Just toss that in there in place of your form, and read the documentation on that function … Read more

Categories login Tags forms, login

Receiving “This content cannot be displayed in a frame” error on login page

Since version 3.4 (or earlier?) WordPress sends a special HTTP header (not in HTML) on login and admin pages: X-Frame-Options: SAMEORIGIN So your browser will show you some text built into the browser, not sent from WordPress. From wp-includes/default-filters.php: add_action( ‘login_init’, ‘send_frame_options_header’, 10, 0 ); add_action( ‘admin_init’, ‘send_frame_options_header’, 10, 0 ); You could create a … Read more

Categories login Tags errors, login, security, user-registration

Front-end login: Redirect user to the post they had created

If I were you, I would use the wp_login_form function to create your form, but it looks like you got everything right, and maybe you have a good reason to use a manual form. <?php wp_login_form(); ?> Either way, you can use this action to update the login redirect, add it to functions.php: add_action( ‘login_redirect’, … Read more

Categories login Tags author, front-end, login

Problems after wp_set_password() containing an apostrophe

The resolution is pretty simply. Those functions require the passwords to be properly escaped. So Instead of this: wp_set_password(‘Test”123’, $userId); You have to do this: wp_set_password(wp_slash(‘Test”123’), $userId); The same goes for wp_update_user() and wp_signon(). Further information and updates on the docs may be visible from this bug report: https://core.trac.wordpress.org/ticket/34297#ticket

Categories plugin-development Tags login, password, plugin-development
Older posts
Newer posts
← Previous Page1 … Page149 Page150 Page151 … Page164 Next →
+ More

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
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • 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