Approving User Account After Completed PayPal Payment

/** * Approve user after PayPal payment status is Complete * * @link https://wpforms.com/developers/how-to-approve-a-user-after-a-paypal-payment/ */ function wpf_dev_activate_user_after_paypal_complete( $fields, $form_data, $payment_id, $data ){ // Add the field ID for the user’s account email $email_field = 3; // Stop editing $user =…Continue reading

How to Add Address Field Validation For Authorize.net

/** * Add address validation for Authorize.net address fields * * @link https://wpforms.com/developers/how-to-add-address-field-validation-for-authorize-net/ */ function wpf_dev_authorize_address_validation( $fields, $entry, $form_data ) { // Optional, you can limit to specific forms. Below, we restrict output to // form #1000. if ( absint(…Continue reading

How to Disable reCAPTCHA for Automated Testing

/** * Disable for automated testing. * * @link https://wpforms.com/developers/how-to-disable-recaptcha-for-automated-testing/ */ // Disable reCAPTCHA assets and initialisation on the frontend. add_filter( ‘wpforms_frontend_recaptcha_disable’, ‘__return_true’ ); // Disable validation and verification on the backend. add_filter( ‘wpforms_process_bypass_captcha’, ‘__return_true’ );Continue reading

How to Customize the Rich Text Field TinyMCE Icons

/** * Customize Rich Text Field TinyMCE buttons for top toolbar. * * @link https://wpforms.com/developers/how-to-customize-the-rich-text-field-tinymce-icons/ */ // Function to change the top toolbar function wpf_dev_customize_tinymce_buttons_toolbar1( $toolbar, $field_id, $field_data ) { $toolbar = [ ‘fontselect’, ‘fontsizeselect’, ‘forecolor’, ‘indent’, ‘outdent’, ‘italic’, ‘styleselect’,…Continue reading

How to Restrict Numbers in a Single Line Text Form Field

/** * Disallow numbers in a single-line text field * * @link https://wpforms.com/developers/how-to-restrict-numbers-in-a-single-line-text-form-field/ */ function wpf_dev_disallow_numbers_text_field( $fields, $entry, $form_data ) { // Optional, you can limit to specific forms. Below, we restrict output to // form ID #1000. if (…Continue reading

Learn how to add Availability label ? in your WooCommerce website. This will help to notify customers how many products are available or if the product is stock out.

add_filter( ‘woocommerce_cart_item_price’, ‘filter_cart_item_price’, 10, 3 ); function filter_cart_item_price( $price_html, $cart_item, $cart_item_key ) { if( $cart_item[‘data’]->is_on_sale() ) { return $cart_item[‘data’]->get_price_html(); } return $price_html; } add_filter( ‘woocommerce_cart_item_subtotal’, ‘filter_cart_item_subtotal’, 10, 3 ); function filter_cart_item_subtotal( $subtotal_html, $cart_item, $cart_item_key ){ $product = $cart_item[‘data’]; $quantity =…Continue reading