WP Simple Pay: Disable Stripe Payment Terms

/** * @link https://library.wpcode.com/snippet/ro8wy3ow/ */ add_filter( ‘simpay_payment_element_config’, /** * @param arary $params Payment Element configuration. * @return array */ function( $config ) { $config[‘terms’][‘usBankAccount’] = ‘never’; $config[‘terms’][‘card’] = ‘never’; return $config; } );Continue reading

Change the action’s string in the refund section – “View Details”

add_filter(‘wcvendors_pro_table_rows_wcv_refund_request’, ‘change_refund_actions_labels’); function change_refund_actions_labels( $rows ) { foreach ( $rows as $row ) { // Add filter to change the label for row with row ID. add_filter(‘wcv_refund_request_row-actions_’ . $row->ID, ‘change_refund_action_label’); } return $rows; } function change_refund_action_label( $actions ) { $actions[‘view_details’][‘label’]…Continue reading

Change the “Commission” header for the Recent Orders table

add_filter( ‘wcvendors_recent_order_table_columns’, ‘change_commission_label’ ); /** * Change the label of the commission column * * @param array $columns The columns to display. * * @return array */ function change_commission_label( $columns ) { $columns[‘commission’] = __( ‘Fees’, ‘wcvendors-pro’ ); return $columns;…Continue reading

Escaping Data

// instead the _e(), __() or _x() use the escaped version _e(‘Email Summary’, ‘duplicator-pro’); // this escaped version is safe to use esc_html_e(‘Email Summary’, ‘duplicator-pro’); ?> // This block is not safe to use since the data is not being…Continue reading

WP Simple Pay: Programmatically Access Payment Metadata After Payment

/** * @link https://library.wpcode.com/snippet/3234p8or/ * * @param StripeEvent $event Stripe Event. * @param StripeSubscription|StripePaymentIntent $object Stripe Subscription or PaymentIntent */ function simpay_custom_create_user( $event, $object ) { $metadata = $object->metadata->toArray(); // Access a custom field with a “Stripe Metadata Label” of…Continue reading

WP Simple Pay: Add More Aggressive Rate Limiting

/** * @link https://library.wpcode.com/snippet/r5p3r9o8/ */ /** * Lower the number of requests allowed for the set timeframe to 3 (default 5). */ add_filter( ‘simpay_rate_limiting_max_rate_count’, /** * @return int The number of requests that can be made in the timeframe. */…Continue reading