function __construct() { global $_js_helper, $wp; require_once 'helper.php'; $this->settings = array('plugin_path' => __DIR__ . DIRECTORY_SEPARATOR, 'plugin_uri' => $this->plugin_uri); $this->plugin_path = __DIR__ . DIRECTORY_SEPARATOR; $home_page['jobsshopper'] = theme_page_setup('jobsshopper', 'Jobs Shopper Front-page', $this->plugin_uri . 'templates/page-jobsshopper.php'); $home_page['jobsboss'] = theme_page_setup('jobsboss', 'Jobs Boss Front-page', $this->plugin_uri . 'templates/page-jobsboss.php'); foreach ($home_page as $key => $area) { update_option('_jobsshopper_' . $key . '_front_page', $area); } $this->helper = new JS_Helper(); $_js_helper = $this->helper; $this->login_page = theme_page_setup('snap-login', 'Login', '', '', 'snap_page'); $this->register_jobsshopper_page = theme_page_setup('snap-register-jobsshopper', 'Register - Jobs Shopper', '', '', 'snap_page'); $this->register_jobsboss_page = theme_page_setup('snap-register-jobsshopper', 'Register - Jobs Boss', '', '', 'snap_page'); $this->init(); }
/** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function jobsshop_setup() { // Not to show admin bar // add_filter('show_admin_bar', '__return_false'); /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on bwf, use a find and replace * to change _NP_TEXT_DOMAIN to the name of your theme in all the jobsshop files */ load_theme_textdomain(_NP_TEXT_DOMAIN, _NP_TEMPLATE_PATH . '/languages'); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); /* * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support('automatic-feed-links'); add_theme_support('title-tag'); register_nav_menus(array('primary' => __('Primary Menu', _NP_TEXT_DOMAIN), 'footer1' => __('Footer Menu 1', _NP_TEXT_DOMAIN), 'footer2' => __('Footer Menu 2', _NP_TEXT_DOMAIN), 'footer3' => __('Footer Menu 3', _NP_TEXT_DOMAIN), 'footer4' => __('Footer Menu 4', _NP_TEXT_DOMAIN), 'footer5' => __('Footer Menu 5', _NP_TEXT_DOMAIN))); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption')); $current_user = wp_get_current_user(); if (!in_array('administrator', $current_user->roles) && !in_array('site_admin', $current_user->roles)) { add_filter('show_admin_bar', '__return_false'); } global $home_page; $home_page = theme_page_setup('home', 'Home page', 'tmpl-home.php'); if (!get_option('page_on_front')) { update_option('page_on_front', $home_page); update_option('show_on_front', 'page'); } theme_load_plugins(); }