/**
* Register theme directories, set a filter that hides themes under certain conditions
*/
function registerThemeDirectories()
{
// No trailing slash, otherwise we get a double slash bug
// @see \PressBooks\Metadata::fixDoubleSlashBug
register_theme_directory(PB_PLUGIN_DIR . 'themes-root');
register_theme_directory(PB_PLUGIN_DIR . 'themes-book');
if (is_admin()) {
if (Book::isBook()) {
add_filter('allowed_themes', array($this, 'allowedBookThemes'));
} else {
add_filter('allowed_themes', array($this, 'allowedRootThemes'));
}
}
}