Last active
January 30, 2016 22:16
-
-
Save MikeGillihan/e3e6752e44f0c0603bc8 to your computer and use it in GitHub Desktop.
Hide themes in theme picker
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 | |
add_filter( 'wp_prepare_themes_for_js', 'PE_hide_themes' ); | |
/** | |
* Prevents themes from being displayed on the Theme picker | |
* @param array $themes Available themes | |
*/ | |
function PE_hide_themes( $themes ) { | |
// List of themes to be hidden | |
$hidden_themes = array( | |
'bb-theme', | |
); | |
// Loop through the array and unset each theme | |
foreach ( $hidden_themes as $theme ) { | |
unset( $themes[$theme] ); | |
} | |
return $themes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment