Created
March 27, 2026 06:32
-
-
Save xlplugins/19aec509ed3d50175682ae6d96ca1143 to your computer and use it in GitHub Desktop.
Express wallets specific shipping method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( | |
| 'wc_stripe_get_formatted_shipping_methods', | |
| static function ( $methods ) { | |
| if ( ! is_array( $methods ) ) { | |
| return $methods; | |
| } | |
| foreach ( $methods as $m ) { | |
| if ( ! empty( $m['id'] ) && 'flat_rate:13' === $m['id'] ) { | |
| return array( $m ); | |
| } | |
| } | |
| return $methods; | |
| }, | |
| 10, | |
| 1 | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment