Last active
June 20, 2018 00:08
-
-
Save ngearing/7b3960d886a5ee711f8d30c2f0200867 to your computer and use it in GitHub Desktop.
Bulk update WordPress options on ManageWP
This file contains 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
<?php | |
$options = [ | |
'theme_my_login' => [ | |
'allow_update' => true, | |
'dismissed_notices' => true, | |
], | |
'wordpress_api_key' => '1', // Akismet API Key. | |
'akismet_comment_form_privacy_notice' => 'hide', | |
'akismet_strictness' => true, | |
]; | |
foreach ( $options as $option_name => $option_data ) { | |
$option = get_option( $option_name ); | |
if ( $option && is_array( $option ) ) { | |
$option_data = array_replace_recursive( $option, $option_data ); | |
} | |
update_option( $option_name, $option_data ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment