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');
do_action('pressbooks_register_theme_directory');
// Check for local themes-root directory
if (realpath(WP_CONTENT_DIR . '/themes-root')) {
register_theme_directory(WP_CONTENT_DIR . '/themes-root');
}
if (is_admin()) {
if (Book::isBook()) {
add_filter('allowed_themes', array($this, 'allowedBookThemes'));
} elseif (!is_network_admin()) {
add_filter('allowed_themes', array($this, 'allowedRootThemes'));
}
}
}