Skip to content

Instantly share code, notes, and snippets.

@MikeGillihan
Last active January 30, 2016 22:16
Show Gist options
  • Save MikeGillihan/e3e6752e44f0c0603bc8 to your computer and use it in GitHub Desktop.
Save MikeGillihan/e3e6752e44f0c0603bc8 to your computer and use it in GitHub Desktop.
Hide themes in theme picker
<?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