WP Simple Pay: Set a Per-Form Custom Amount Programmatically

/** * @link https://library.wpcode.com/snippet/7oq8llow/ * * @param \SimplePay\Core\PaymentForm\PriceOption[] $price_options Payment form price options. * @param \SimplePay\Core\Abstracts\Form $form Payment form. * @return \SimplePay\Core\PaymentForm\PriceOption[] */ add_filter( ‘simpay_get_payment_form_price_options’, function( $price_options, $form ) { // BEGIN UPDATES. $form_id = 150; // Payment form ID.…Continue reading

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