WP Simple Pay: Translate Stripe Error Messages

/** * @link https://library.wpcode.com/snippet/rov9rl2l/ */ add_filter( ‘simpay_get_localized_error_list’, /** * @param array $messages Stripe error messages. Keyed by error code. * @return array */ function( $messages ) { // https://stripe.com/docs/error-codes#coupon-expired $messages[‘coupon_expired’] = ‘The coupon has expired and is no longer valid’;…Continue reading

WP Simple Pay: Use Payment Form Description as Payment Description

/** * @link https://library.wpcode.com/editor/ro8wd9ow/ */ add_filter( ‘simpay_get_paymentintent_args_from_payment_form_request’, /** * @param array $args Payment Intent arguments. * @param \SimplePay\Core\Abstracts\Form $form Form instance. */ function( $args, $form ) { $args[‘description’] = $form->item_description; return $args; }, 10, 2 );Continue reading

Disable Blog Posts

// Remove side menu add_action( ‘admin_menu’, function () { remove_menu_page( ‘edit.php’ ); } ); // Remove +New post in top Admin Menu Bar add_action( ‘admin_bar_menu’, function ( $wp_admin_bar ) { $wp_admin_bar->remove_node( ‘new-post’ ); }, 999 ); // Remove Quick Draft…Continue reading

Remove the Key Text on Conversational Forms

/* Remove the Key Text from Conversational Forms Original doc link: https://wpforms.com/developers/how-to-change-the-key-text-on-conversational-forms/ For support, please visit: https://www.facebook.com/groups/wpformsvip */ #wpforms-conversational-form-page div[class^=’wpforms-field-‘] li:not(.wpforms-image-choices-item) label:before, #wpforms-conversational-form-page div[class*=’ wpforms-field-‘] li:not(.wpforms-image-choices-item) label:before, #wpforms-conversational-form-page div[class^=’wpforms-field-‘] li:not(.wpforms-image-choices-item):not(.wpforms-selected) label:hover:before, #wpforms-conversational-form-page div[class*=’ wpforms-field-‘] li:not(.wpforms-image-choices-item):not(.wpforms-selected) label:hover:before, #wpforms-conversational-form-page div[class^=’wpforms-field-‘] li:not(.wpforms-image-choices-item):not(.wpforms-selected) label.wpforms-field-item-hover:before,…Continue reading

Disable a Form Field to Prevent User Input

/** * Make standard form fields to make read-only * To apply, add CSS class ‘wpf-disable-field’ (no quotes) to field in form builder * * @link https://wpforms.com/developers/disable-a-form-field-to-prevent-user-input/ * * For support, please visit: https://www.facebook.com/groups/wpformsvip */ function wpf_dev_disable_field() { ?>Continue reading

Block IP Addresses From Completing Your Form

/** * Block form submissions based on IP address * * @link https://wpforms.com/developers/how-to-block-ip-addresses-from-completing-your-form/ * * For support, please visit: https://www.facebook.com/groups/wpformsvip */ function wpf_ip_block( $fields, $entry, $form_data ) { // Get the current users IP address $ip_address = wpforms_get_ip(); // Enter…Continue reading