static function get_options() { // Cache options $cache = new PLS_Cache('Theme PLS Options'); $cache_args = array(); if ($options = $cache->get($cache_args)) { self::$styles = array_merge(self::$styles, $options); return; } require PLS_Route::locate_blueprint_option('init.php'); require_if_theme_supports("pls-user-options", PLS_Route::locate_blueprint_option('user.php')); require_if_theme_supports("pls-search-options", PLS_Route::locate_blueprint_option('search.php')); require_if_theme_supports("pls-color-options", PLS_Route::locate_blueprint_option('colors.php')); require_if_theme_supports("pls-slideshow-options", PLS_Route::locate_blueprint_option('slideshow.php')); require_if_theme_supports("pls-typography-options", PLS_Route::locate_blueprint_option('typography.php')); require_if_theme_supports("pls-header-options", PLS_Route::locate_blueprint_option('header.php')); require_if_theme_supports("pls-navigation-options", PLS_Route::locate_blueprint_option('navigation.php')); require_if_theme_supports("pls-listing-options", PLS_Route::locate_blueprint_option('listings.php')); require_if_theme_supports("pls-post-options", PLS_Route::locate_blueprint_option('post.php')); require_if_theme_supports("pls-widget-options", PLS_Route::locate_blueprint_option('widget.php')); require_if_theme_supports("pls-footer-options", PLS_Route::locate_blueprint_option('footer.php')); require_if_theme_supports("pls-css-options", PLS_Route::locate_blueprint_option('css.php')); // Cache options $cache->save(self::$styles); }
public static function metadata_customizations() { include_once PLS_Route::locate_blueprint_option('meta.php'); //throws random errors if you aren't an admin, can't be loaded with admin_init... if (!is_admin() || !class_exists('Tax_Meta_Class')) { return; } $config = array('id' => 'demo_meta_box', 'title' => 'Demo Meta Box', 'pages' => array('state', 'city', 'zip', 'street', 'neighborhood'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false); $my_meta = new Tax_Meta_Class($config); foreach (self::$custom_meta as $meta) { switch ($meta['type']) { case 'text': $my_meta->addText($meta['id'], array('name' => $meta['label'])); break; case 'textarea': $my_meta->addTextarea($meta['id'], array('name' => $meta['label'])); break; case 'wysiwyg': $my_meta->addCheckbox($meta['id'], array('name' => $meta['label'])); break; case 'image': $my_meta->addImage($meta['id'], array('name' => $meta['label'])); break; case 'file': $my_meta->addFile($meta['id'], array('name' => $meta['label'])); break; case 'checkbox': $my_meta->addCheckbox($meta['id'], array('name' => $meta['label'])); break; } } $my_meta->Finish(); }