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
<?php | |
if( ! is_multisite() ){ | |
return; | |
} | |
function pre_get_option( $value, $option ){ | |
$blog_id = get_current_blog_id(); | |
$meta = get_blog_meta( $blog_id, $option, true ); | |
if( false != $meta ){ |
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
<?php | |
/** | |
* Loop through all options and save in the blog meta table | |
*/ | |
class Blog_Meta_Migration extends WP_CLI_Command { | |
/** | |
* Loop through all options and save in the blog meta table | |
* |
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
'stylesheet', | |
'show_on_front', | |
'blog_charset', | |
'template', | |
'WPLANG', | |
'cron', | |
'blogname', | |
'siteurl', | |
'post_count', | |
'home', |
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
<?php | |
/** | |
* Sync key options with blog meta | |
* | |
* @package Blog_Meta_Sync | |
* @author Jonathan Harris <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://www.jonathandavidharris.co.uk/ | |
* @copyright 2017 Spacedmonkey | |
* |
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
<?php | |
/** | |
* Sync key options with blog meta | |
* | |
* @package Blog_Meta_Sync | |
* @author Jonathan Harris <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://www.jonathandavidharris.co.uk/ | |
* @copyright 2017 Spacedmonkey | |
* |
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('pre_option_blog_charset', function(){ return 'UTF-8'; }); | |
add_filter('pre_option_html_type', function(){ return 'text/html'; }); | |
add_filter('pre_option_link_manager_enabled', '__return_true'); | |
add_filter('pre_option_use_smilies', '__return_true'); | |
add_filter('pre_option_timezone_string', '__return_null'); | |
add_filter( 'pre_option_category_base', '__return_empty_string' ); | |
add_filter( 'pre_option_tag_base', '__return_empty_string' ); | |
add_filter( 'pre_option_avatar_default', function(){ return 'mystery'; }); | |
add_filter( 'pre_option_avatar_rating', function(){ return 'G'; }); | |
add_filter( 'pre_option_show_avatars', function(){ return '1'; }); |
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
class WP_Short_Circuit_Result { | |
private $name = null; | |
private $value = null; | |
public $has_changed = false; | |
public function __construct( $name = null, $value = null ) { | |
$this->name = $name; |
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
$properties = array( 'blogname', 'siteurl', 'post_count', 'home' ); | |
foreach ( $properties as $property ) { | |
add_action("add_option_".$property,"add_option_site_meta" 99, 2); | |
add_action("delete_option_".$property,"delete_option_site_meta" 99, 1); | |
add_action("update_option_".$property,"update_option_site_meta" 99, 3); | |
} | |
function delete_option_site_meta( $option ){ | |
delete_site_meta(get_current_blog_id(), $option); | |
} |
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
<?php | |
/** | |
* Force cookie constants to be local domain / path | |
* after multisite is loaded. | |
*/ | |
add_action( | |
'ms_loaded', function () { | |
$site = get_site(); |
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('s3_uploads_s3_client_params', function($params){ | |
$params['endpoint'] = 'https://ams3.digitaloceanspaces.com'; | |
return $params; | |
}, 10, 1); |