-
-
Save mustafauysal/2487dc1ff3eceff2804e to your computer and use it in GitHub Desktop.
Update site info and activate plugins that I only need local
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 | |
if ( defined( 'WP_LOCAL_DEV' ) && WP_LOCAL_DEV ) { | |
update_option('siteurl','http://local.example.dev'); | |
update_option('home','http://local.example.dev'); | |
function activate_local_plugin( $plugin ) { | |
$current = get_option( 'active_plugins' ); | |
$plugin = plugin_basename( trim( $plugin ) ); | |
if ( !in_array( $plugin, $current ) ) { | |
$current[] = $plugin; | |
sort( $current ); | |
do_action( 'activate_plugin', trim( $plugin ) ); | |
update_option( 'active_plugins', $current ); | |
do_action( 'activate_' . trim( $plugin ) ); | |
do_action( 'activated_plugin', trim( $plugin) ); | |
} | |
return null; | |
} | |
activate_local_plugin('uploads-by-proxy/uploads-by-proxy.php'); | |
} |
@qant It seems like a rookie mistake, and absolutely no making sense at all. Btw I'm wondering, how did you found a secret gist from 2014? 😅
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i wonder why so many trim()?