Created
September 30, 2021 18:29
-
-
Save grantalltodavid/1a4f3553e80ae10d73ff2483e462dd5b to your computer and use it in GitHub Desktop.
WP Wham Product Open Pricing: change per-product metabox's "enabled" setting default to "yes"
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( 'wpwham_product_open_pricing_metabox_options', 'wpwham_20210930_change_metabox_defaults' ); | |
| function wpwham_20210930_change_metabox_defaults( $options ) { | |
| foreach ( $options as &$option ) { | |
| if ( $option['name'] === 'alg_wc_product_open_pricing_enabled' ) { | |
| $option['default'] = 'yes'; | |
| break; | |
| } | |
| } | |
| return $options; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment