
如何编辑本地电脑Hosts文件 – 在更新DNS之前预览站点
wp_get_active_and_valid_themes ( No parameters )
wp_get_active_and_valid_themes: 这个函数返回一个活跃和有效主题的数组。它扫描主题目录并检索所有以”style.css”结尾的文件的列表。然后它检查每个文件以确保它有一个有效的主题头。
检索一个活跃和有效的主题数组。
在升级或安装WordPress时,不会返回任何主题。
function wp_get_active_and_valid_themes() { global $pagenow; $themes = array(); if ( wp_installing() && 'wp-activate.php' !== $pagenow ) { return $themes; } if ( TEMPLATEPATH !== STYLESHEETPATH ) { $themes[] = STYLESHEETPATH; } $themes[] = TEMPLATEPATH; /* * Remove themes from the list of active themes when we're on an endpoint * that should be protected against WSODs and the theme is paused. */ if ( wp_is_recovery_mode() ) { $themes = wp_skip_paused_themes( $themes ); // If no active and valid themes exist, skip loading themes. if ( empty( $themes ) ) { add_filter( 'wp_using_themes', '__return_false' ); } } return $themes; }