ERROR: please fill the required fields (name, email). in Wordpress Comment - wordpress

I have a problem submitting comment form for not signed in users. When I try to submit the forms, it is giving me an error -
ERROR: please fill the required fields (name, email).
I am using default template for WordPress. I have tried to deactivate the plugins one by one to make sure that if this is not a conflict, but then it is also not working. However, It's working fine for logged in users.

You can just make the email and name fields not required, To achieve this, go to Dashboard > Settings > Discussion and uncheck the Comment author must fill out name and email.
Edit:
Read the comments for actual solution ...

I had the same issue. Check the code below within your theme and remove 'comment-form' and 'comment-list'.
add_theme_support(
'html5',
array(
'search-form',
//'comment-form',
//'comment-list',
'gallery',
'caption',
)
);
Note this question should be on WordPress stackoverflow.

Related

Don't redirect users to wp-comments-post.php instead show required directly in input fields

I am looking forward to 2 things:
Rename "wp-comment-post" to any other name
Don't redirect users to the wp comment error page.
I have found a website that shows comment error messages on the form without any redirection. I am looking forward to something like that.
I'm sharing 1 blog post of that website, when you scroll down to the comment form, you can discover that the error is showing on the form. Which looks really nice and simple.
Link: https://neilpatel.com/how-to-start-a-blog/
Please help me out with codes and which files to put those.
Thanks in advance!
I had the same issue. Check the code below within your theme and remove 'comment-form' and 'comment-list'.
add_theme_support(
'html5',
array(
'search-form',
//'comment-form',
//'comment-list',
'gallery',
'caption',
)
);
Note this question should be on WordPress stackoverflow.

Removing comment form consent from Wordpress

In order to remove the consent field from the comment form on blog posts the following filter is added to my child themes function.php:
add_filter('comment_form_default_fields', 'unset_consent_field');
function unset_consent_field($fields){
if(isset($fields['cookies']))
unset($fields['cookies']);
return $fields;
}
The consent field remains however. Replacing 'cookies' with 'url' successfully removes the URL field so im not sure why its not working for the cookies field.
Any ideas what could be causing this and what the solution is?
The checkbox can be removed under Wordpress Settings -> Privacy

Wordpress Woocommerce plugin mail triggering

Mail not sending when status changed from processing to on-hold and processing to failed.
Kindly tell me how to achieve this. Thanks in advance
Even that kind of questions (directly asking the need without any research or any part of code) are not welcomed here, I want to help you about that by giving the basic idea.
In the file "wp-content/plugins/woocommerce/includes/class-wc-emails.php", search for the "public static function init_transactional_emails()" and check "$email_actions" array there.
$email_actions = apply_filters(
'woocommerce_email_actions', array(
'woocommerce_low_stock',
'woocommerce_no_stock',
'woocommerce_product_on_backorder',
'woocommerce_order_status_pending_to_processing',
'woocommerce_order_status_pending_to_completed',
'woocommerce_order_status_processing_to_cancelled',
'woocommerce_order_status_pending_to_failed',
'woocommerce_order_status_pending_to_on-hold',
'woocommerce_order_status_failed_to_processing',
'woocommerce_order_status_failed_to_completed',
'woocommerce_order_status_failed_to_on-hold',
'woocommerce_order_status_on-hold_to_processing',
'woocommerce_order_status_on-hold_to_cancelled',
'woocommerce_order_status_on-hold_to_failed',
'woocommerce_order_status_completed',
'woocommerce_order_fully_refunded',
'woocommerce_order_partially_refunded',
'woocommerce_new_customer_note',
'woocommerce_created_customer',
)
);
Since after every update of Woocommerce plugin any changes you made on those files will be gone, you need to add your email trigger for status changes you mentioned by either using a hook or overriding the files using your child theme.
About your request, for "from processing to on-hold" you need to add:
'woocommerce_order_status_processing_to_on-hold',
About overriding a file (or function) from includes folder of Woocommerce you may check this post: Override woocommerce files from includes folder
I hope this will help you to solve it. Have a good day.

Wordpress post to user relation ship

Is there any way to connect post to specific user in wordpress. Is there any plugin available. Or any one know the code for doing that.I have a custom post type stories. When adding stories i need to chose the corresponding users from user list. Please help
Install Post2post https://wordpress.org/plugins/posts-to-posts/
Then in your function.php write this code
p2p_register_connection_type ( array(
'name' => 'releated_user',
'from' => 'story',
'to' => 'user'
) );
here story is your custom post type slug. related_user is just a connection name.You can name it as what you like.
Then in your post type section you can see an option for selecting corresponding user.
In the custom post type setup, you first need to ensure that this post type allows for authors to be set.
This comes in from the arguments when registering the post type.
$args = array('supports'=>array('author'=>true));
If you have an admin account, you can set who the author is using the quick edit function or by allowing to see it under screen options on the full edit page.
Other than that, you can make your own complete post meta box to allow for multiple authors. I cant see a plugin on the wordpress plugin directory so creating your own to fit your needs and wants will be your best bet.

how to change the link in the wordpress email with newpassword?

how to change the link in the wordpress email with newpassword?
this information we get when we click on forgot password.
username : admin
password : admin
http://www.example.com/wp-login.php
here i want to change this url "http://www.example.com/wp-login.php" and set my own url... how can i do?
some reference code:
if ( !function_exists('is_user_logged_in') ) :function is_user_logged_in() {
$user = wp_get_current_user();
You can hook into the retrieve_password_message filter
function someFunction($message, $key){
}
add_filter('retrieve_password_message', 'someFunction');
You would then have to use the "someFunction" function to parse the $message variable and change the link.
The message variable contains the entire message. So you could simply trim the message based on the number of characters then tack on your new link...
HTH
(Untested)
Using hooks would be my first thought so that you wouldn't have to edit any core files, however I have used the SB Welcome Email Editor plugin a couple times for this exact reason. Their are a couple plugins like this out their and they are fairly light weight and allow full customization of all Wordpress generated emails.
Try using a plugin such as Theme My Login, which does everything for you.
Editing core wordpress files is never a good idea, when updating wordpress, you'll loose all your work.
You can simply follow steps if you want to edit your code file.
Go to your wordpress folder. Look for the following files:
1. /wp-login.php
2. /includes/functions.php
Change the all the codes which contains wp-login.php into your custom URL.
for example: admin.php or client-login.php
Now you can changed your login/signup URL into your custom URL.
Known issue: You can find some database error if you make any mistakes. Just refresh the page and try with the customized Url it will work...
Example site I used here : http://androideveloper.com/admin.php from http://androideveloper.com/wp-login.php
Cheers.

Resources