Riddhi Mehta
Forum Replies Created
-
Forum: Plugins
In reply to: [WPC Product Bundles for WooCommerce] Change Cart qty based on Bundle ProductYep it’s working thank you for the help
No need of help it resolved.
Thanks for help! ??
Forum: Plugins
In reply to: [WooCommerce PayPal Checkout Payment Gateway] Don’t work In indiaOk thanks for your support I will check this option and let you know If I found any difficulty.
Thanks,
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Add custom Field data in PDFHello Alexmigf,
Thanks a ton for you help. It solved my problem and save my energy.
Thanks,
Riddhi MehtaForum: Plugins
In reply to: [JWT Authentication for WP REST API] Customise error messageHello All,
I found the solution for the same. This plugin use the default WordPress error. so, you can use below code for change message in the API response. I got the success in this. Hope it’s help to you too!!
remove_filter( 'authenticate', 'wp_authenticate_username_password' ); add_filter( 'authenticate', 'wpse_115539_authenticate_username_password', 20, 3 ); /** * Remove WordPress filer and write our own with changed error text. */ function wpse_115539_authenticate_username_password( $user, $username, $password ) { if ( is_a($user, 'WP_User') ) return $user; if ( empty( $username ) || empty( $password ) ) { if ( is_wp_error( $user ) ) return $user; $error = new WP_Error(); if ( empty( $username ) ) $error->add( 'empty_username', __('<strong>ERROR</strong>: The username field is empty.' ) ); if ( empty( $password ) ) $error->add( 'empty_password', __( '<strong>ERROR</strong>: The password field is empty.' ) ); return $error; } $user = get_user_by( 'login', $username ); if ( !$user ) return new WP_Error( 'invalid_username', sprintf( __( '<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?' ), wp_lostpassword_url() ) ); $user = apply_filters( 'wp_authenticate_user', $user, $password ); if ( is_wp_error( $user ) ) return $user; if ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) return new WP_Error( 'incorrect_password', sprintf( __( '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?' ), $username, wp_lostpassword_url() ) ); return $user; }
For reference please refer this link: https://wordpress.stackexchange.com/questions/115539/custom-login-errors-and-variables-i-can-use
Thanks,
Riddhi Mehta- This reply was modified 5 years, 6 months ago by Riddhi Mehta.
- This reply was modified 5 years, 6 months ago by Andrew Nevins.
Forum: Plugins
In reply to: [JWT Authentication for WP REST API] Feature Request: get_current_user_idIf you want to use the token then please use this code for the same.
function add_extra_para($data, $user) { $data = array( 'success' => true, 'token' => $data['token'], 'user_email' => $user->data->user_email, 'user_nicename' => $user->data->user_nicename, 'user_display_name' => $user->data->display_name, 'user_id' => $user->data->ID, ); return $data; } add_filter('jwt_auth_token_before_dispatch', 'add_extra_para', 10, 2);
- This reply was modified 5 years, 6 months ago by Riddhi Mehta.
Hello Team,
I found the solution for this task,
We used this for custom error,
instead of this,
$ultimatemember->form->add_error( ‘user_login’, ‘Your username must not contain the word admin.’ );
We have to use this one,
UM()->form()->add_error( ‘user_login’, ‘Your username must not contain the word admin.’ );
And the validation will added.
Thanks,
Riddhi MehtaHello Team,
I found the solution for this. Just use that extend file in the function.php and you can remove that filter. After that if user can not check the GDPR cehck box then also, form will submitted successfully.
Use this code, in your fucntion.php
use WPGDPRC\Includes\Extensions\CF7;
remove_filter( ‘wpcf7_validate_wpgdprc’, array(CF7::getInstance(), ‘validateField’) );
This solved my problem. I hop It useful for others too…!!!
Forum: Fixing WordPress
In reply to: Recommend Media CleanerHello sparkleballlady,
For Image/media cleaner you can use ‘Media Cleaner’ plugin.
you can download it from this link: https://www.ads-software.com/plugins/media-cleaner/screenshots/
Thanks,