예제 #1
0
 public static function start()
 {
     global $argv, $theme_name;
     parent::initialize();
     require_once Wordless::join_paths(self::$plugin_dir, "wordless", "theme_builder.php");
     $theme_name = $argv[1] ? $argv[1] : 'wordless';
     $permissions = substr(sprintf('%o', fileperms(self::$plugin_dir)), -4);
     $builder = new WordlessThemeBuilder($theme_name, $theme_name, intval($permissions, 8));
     $builder->build();
 }
예제 #2
0
 public static function start()
 {
     parent::initialize();
     // Determine theme name
     foreach (scandir(self::$current_dir . '/wp-content/themes') as $theme_dir) {
         if (in_array($theme_dir, array('.', '..', 'index.php')) && !is_dir($theme_dir)) {
             continue;
         }
         $previous_theme_name = WordlessBridge::$theme_name;
         WordlessBridge::$theme_name = $theme_dir;
         if (Wordless::theme_is_wordless_compatible()) {
             if (basename(self::$current_dir) == $theme_dir) {
                 // A theme with the same name as the site is Wordless-compatible, this is probably the one we want
                 break;
             }
         } else {
             WordlessBridge::$theme_name = $previous_theme_name;
         }
     }
     require get_template_directory() . '/config/initializers/wordless_preferences.php';
     Wordless::register_preprocessors();
     Wordless::compile_assets();
 }
예제 #3
0
 public static function initialize()
 {
     self::$current_dir = getcwd();
     self::$plugin_dir = self::$current_dir . '/wp-content/plugins/wordless';
     require_once self::$plugin_dir . "/wordless/wordless.php";
 }