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 | |
/** | |
* Remove Google Analytics warning from network admin. | |
*/ | |
function remove_analytics_warning_from_network_admin() { | |
if ( is_network_admin() ) { | |
global $ga_admin; | |
remove_filter( 'admin_footer', array( $ga_admin, 'warning' ) ); | |
} | |
} |
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 | |
/** | |
* Blacklist Jetpack modules. | |
*/ | |
function blacklist_jetpack_modules( $modules ){ | |
$jp_mods_to_disable = array( | |
'contact-form', | |
'shortlinks', | |
); |
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 | |
/** | |
* Auto activate Jetpack modules. | |
*/ | |
function activate_jetpack_modules( $modules ){ | |
$modules = array( | |
'widget-visibility', | |
'custom-css', | |
); | |
return $modules; |
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 | |
/** | |
* Show info for current stage in admin toolbar. | |
*/ | |
function show_current_stage_info( $wp_admin_bar ) { | |
if ( defined( 'WP_STAGE' ) && WP_STAGE != '%%WP_STAGE%%' ) { | |
$args = array( | |
'id' => 'current-stage', | |
'title' => '<span class="dashicons dashicons-admin-site" style="font-family: \'dashicons\'; font-size: 20px; margin-right: 5px;"></span> Current stage: ' . WP_STAGE, | |
'meta' => array( 'class' => 'current-stage' ), |
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 | |
/** | |
* Limit file extensions to load from CDN. | |
*/ | |
function override_cdn_file_extensions() { | |
return array( 'jpe?g', 'gif', 'png', 'bmp' ); | |
} | |
add_filter( 'stage_wp_cdn_extensions', 'override_cdn_file_extensions' ); |
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 | |
add_filter( 'option_active_plugins', 'activate_local_plugins' ); | |
/** | |
* Add our local plugins to the list of active plugins. | |
*/ | |
function activate_local_plugins( $plugins ) { | |
if ( '127.0.0.1' == $_SERVER['SERVER_ADDR'] ) { | |
$local_plugins = array( | |
'wordpress-beta-tester/wp-beta-tester.php', | |
'wordpress-importer/wordpress-importer.php', |
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 | |
/** | |
* Load different configuration files for different stages. | |
*/ | |
if ( file_exists( $local_config = dirname( __FILE__ ) . '/local-config.php' ) ) { | |
require $local_config; // Configurations for your local stage only. | |
define( 'WP_STAGE', 'local' ); | |
} elseif ( file_exists( $staging_config = dirname( __FILE__ ) . '/staging-config.php' ) ) { | |
require $staging_config; // Configurations for your testing stage only. | |
define( 'WP_STAGE', 'staging' ); |
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 | |
add_filter( 'option_active_plugins', 'activate_local_plugins' ); | |
/** | |
* Add our local plugins to the list of active plugins. | |
*/ | |
function activate_local_plugins( $plugins ) { | |
if ( defined( 'WP_STAGE' ) && 'local' == WP_STAGE ) { | |
$local_plugins = array( | |
'wordpress-beta-tester/wp-beta-tester.php', | |
'wordpress-importer/wordpress-importer.php', |
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 | |
// Remove users and meta data. | |
function fix_wpsc_clear_customer_meta() { | |
global $wpdb; | |
require_once( ABSPATH . 'wp-admin/includes/user.php' ); | |
$purge_count = 200; | |
$sql = " | |
SELECT user_id | |
FROM {$wpdb->usermeta} | |
WHERE |
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 ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { | |
add_action( 'wp_ajax_wpsc_migrate_anonymous_user', '_wpsc_meta_migrate_anonymous_user_worker' ); | |
add_action( 'wp_ajax_nopriv_wpsc_migrate_anonymous_user', '_wpsc_meta_migrate_anonymous_user_worker' ); | |
function _wpsc_meta_migrate_anonymous_user_worker() { | |
global $wpdb; |