mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
15 lines
440 B
Text
15 lines
440 B
Text
$option_name = 'woocommerce_show_marketplace_suggestions' ;
|
|
$new_value = 'no' ;
|
|
|
|
if ( get_option( $option_name ) !== false ) {
|
|
|
|
// The option already exists, so we just update it.
|
|
update_option( $option_name, $new_value );
|
|
|
|
} else {
|
|
|
|
// The option hasn't been added yet. We'll add it with $autoload set to 'no'.
|
|
$deprecated = null;
|
|
$autoload = 'no';
|
|
add_option( $option_name, $new_value, $deprecated, $autoload );
|
|
}
|