=' ) ) { if ( defined('VIMEOGRAPHY_DEV') && VIMEOGRAPHY_DEV ) { $plugin['app_path'] = 'https://localhost:8080/'; $plugin['app_js'] = 'https://localhost:8080/scripts.js'; $plugin['app_css'] = 'https://localhost:8080/styles.css'; } else { $manifest = $plugin['plugin_path'] . 'dist/manifest.json'; $manifest = file_get_contents( $manifest ); $manifest = (array) json_decode( $manifest ); $plugin['app_path'] = plugins_url( 'dist/', $plugin_path ); $plugin['app_js'] = plugins_url( sprintf( 'dist/%s', $manifest['main.js'] ), $plugin_path ); if ( isset( $manifest['main.css'] ) ) { $plugin['app_css'] = plugins_url( sprintf( 'dist/%s', $manifest['main.css'] ), $plugin_path ); } } } $this->themes[] = $plugin; } // Load all addons into the public addons array $this->installed_addons[] = $plugin; return $this; } /** * Retrieves the meta data from the headers of a given plugin file. * * @access private * @static * @param mixed $plugin_file * @return void */ private static function _get_plugin_data($plugin_file) { $default_headers = array( 'name' => 'Theme Name', 'theme-uri' => 'Theme URI', 'version' => 'Version', 'description' => 'Description', 'author' => 'Author', 'author-uri' => 'Author URI', ); return get_file_data( $plugin_file, $default_headers ); } /** * Sets the active theme if it is found to be installed * and activated. * * @param string $theme_name */ public function set_active_theme($theme_name) { foreach ( $this->themes as $index => $theme) { if ( strtolower( $theme['name'] ) === strtolower( $theme_name ) ) { $this->active_theme = $theme; } } if ( ! $this->active_theme ) { throw new Vimeography_Exception( __('The Vimeography theme you are trying to use is not installed or activated.', 'vimeography') ); } return $this; } }