How to add function to custom fields when page/post has a password?
How to add function to custom fields when page/post has a password?
How to add function to custom fields when page/post has a password?
You just need to add your own action before any errors are returned, and if there is an error, redirect back to your page and display the error add_action( ‘lostpassword_post’, ‘smyles123_check_for_errors’ ); function smyles123_check_for_errors( $errors ){ if ( $errors->get_error_code() ){ // REDIRECT BACK TO YOUR PAGE TO SHOW ERRORS // You can probably just append … Read more
I assume the code you added to functions.php is a filter for ‘the_password_form’, where you’ve got something like: function my_protected_post_form () { $myCustomizedFormCode=”<form action=….” return $myCustomizedFormCode; } add_filter (‘the_password_form’, ‘my_protected_post_form’); So where you have the instructions to the user in that custom form code string, you just need some simple HTML to provide the link … Read more
You can use the same principle as the worked example, however replace $_GET with $_POST. So you’d have something like this towards the end: // Your custom check for the ‘$_POST’ content // …also check if there in fact is a password // …and if the user is a repeated visitor, do not set the … Read more
There is nothing wrong with the “just MD5 also works” on my WordPress installation. As I was creating users via INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, display_name,user_registered) VALUES (‘login’, MD5(‘password’), ‘Name Surname’, ’[email protected]’, ‘username’,now()); INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, (Select max(id) FROM wp_users), ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’); INSERT INTO wp_usermeta (umeta_id, user_id, … Read more
Your local server probably has problems sending mail. There are ways to fix that, but it is probably easiest to change the password in the database directly. Since you’ve made a copy of your site I am going to assume you have access to the database through something like PhpMyAdmin. Follow these instructions to change … Read more
check this may be useful i had similar issue https://ivycat.com/protect-wordpress-login-brute-force-attacks-htaccess/
After reviewing a reset password link, I realised that two variables were being passed via $_GET: key and login. I’ve added the below code to the beginning of my redirect_user() function: if(isset($_GET[‘key’]) && isset($_GET[‘login’])) { return ; } It didn’t fix the issue and i was still being redirected to the login page whenever I … Read more
The template name is stored in the postmeta table, you can identify the page template by different ways but i would do with like: 1. $template = get_post_meta( $post->ID, ‘_wp_page_template’, true ); echo “Template: ” . $template; 2. echo basename( get_page_template() )
How to Password Protect whole site except for some subdirectories