/** * Register post type. * * @since 2.0.0 */ public function register_post_type() { // Get values and sanitize $name = wpex_get_staff_name(); $singular_name = wpex_get_staff_singular_name(); $slug = wpex_get_mod('staff_slug'); $slug = $slug ? esc_html($slug) : 'staff-member'; $menu_icon = wpex_get_staff_menu_icon(); $staff_search = wpex_get_mod('staff_search', true); $staff_search = !$staff_search ? true : false; // Declare args and apply filters $args = apply_filters('wpex_staff_args', array('labels' => array('name' => $name, 'singular_name' => $singular_name, 'add_new' => esc_html__('Add New', 'total'), 'add_new_item' => esc_html__('Add New Item', 'total'), 'edit_item' => esc_html__('Edit Item', 'total'), 'new_item' => esc_html__('Add New Staff Item', 'total'), 'view_item' => esc_html__('View Item', 'total'), 'search_items' => esc_html__('Search Items', 'total'), 'not_found' => esc_html__('No Items Found', 'total'), 'not_found_in_trash' => esc_html__('No Items Found In Trash', 'total')), 'public' => true, 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'revisions', 'author', 'page-attributes'), 'capability_type' => 'post', 'rewrite' => array('slug' => $slug), 'has_archive' => false, 'menu_icon' => 'dashicons-' . $menu_icon, 'menu_position' => 20, 'exclude_from_search' => $staff_search)); // Register the post type register_post_type('staff', $args); }
/** * Start things up * * @since 1.6.0 */ public function __construct() { // Array of theme "parts/addons" that can be enabled/disabled $this->theme_addons = apply_filters('wpex_theme_addons', array('under_construction' => array('label' => esc_html__('Under Construction', 'total'), 'icon' => 'dashicons dashicons-hammer', 'category' => esc_html__('Core', 'total')), 'recommend_plugins' => array('label' => esc_html__('Recommend Plugins', 'total'), 'icon' => 'dashicons dashicons-admin-plugins', 'category' => esc_html__('Core', 'total')), 'schema_markup' => array('label' => esc_html__('Schema Markup', 'total'), 'icon' => 'dashicons dashicons-feedback', 'category' => esc_html__('SEO', 'total')), 'minify_js' => array('label' => esc_html__('Minify Javascript', 'total'), 'icon' => 'dashicons dashicons-performance', 'category' => esc_html__('Optimizations', 'total')), 'custom_css' => array('label' => esc_html__('Custom CSS', 'total'), 'icon' => 'dashicons dashicons-admin-appearance', 'category' => esc_html__('Developers', 'total')), 'custom_js' => array('label' => esc_html__('Custom JS', 'total'), 'icon' => 'dashicons dashicons-media-code', 'category' => esc_html__('Developers', 'total'), 'disabled' => true), 'custom_actions' => array('label' => esc_html__('Custom Actions', 'total'), 'icon' => 'dashicons dashicons-editor-code', 'category' => esc_html__('Developers', 'total')), 'favicons' => array('label' => esc_html__('Favicons', 'total'), 'icon' => 'dashicons dashicons-nametag', 'category' => esc_html__('Core', 'total')), 'portfolio' => array('label' => wpex_get_portfolio_name(), 'icon' => 'dashicons dashicons-' . wpex_get_portfolio_menu_icon(), 'category' => esc_html__('Post Types', 'total')), 'staff' => array('label' => wpex_get_staff_name(), 'icon' => 'dashicons dashicons-' . wpex_get_staff_menu_icon(), 'category' => esc_html__('Post Types', 'total')), 'testimonials' => array('label' => wpex_get_testimonials_name(), 'icon' => 'dashicons dashicons-' . wpex_get_testimonials_menu_icon(), 'category' => esc_html__('Post Types', 'total')), 'post_series' => array('label' => esc_html__('Post Series', 'total'), 'icon' => 'dashicons dashicons-edit', 'category' => esc_html__('Core', 'total')), 'footer_builder' => array('label' => esc_html__('Footer Builder', 'total'), 'icon' => 'dashicons dashicons-editor-insertmore', 'category' => esc_html__('Core', 'total')), 'custom_admin_login' => array('label' => esc_html__('Custom Login Page', 'total'), 'icon' => 'dashicons dashicons-lock', 'category' => esc_html__('Core', 'total')), 'custom_404' => array('label' => esc_html__('Custom 404 Page', 'total'), 'icon' => 'dashicons dashicons-dismiss', 'category' => esc_html__('Core', 'total')), 'customizer_panel' => array('label' => esc_html__('Customizer Manager', 'total'), 'icon' => 'dashicons dashicons-admin-settings', 'category' => esc_html__('Optimizations', 'total')), 'custom_wp_gallery' => array('label' => esc_html__('Custom WordPress Gallery', 'total'), 'icon' => 'dashicons dashicons-images-alt2', 'category' => esc_html__('Core', 'total')), 'widget_areas' => array('label' => esc_html__('Widget Areas', 'total'), 'icon' => 'dashicons dashicons-welcome-widgets-menus', 'category' => esc_html__('Core', 'total')), 'custom_widgets' => array('label' => esc_html__('Custom Widgets', 'total'), 'icon' => 'dashicons dashicons-list-view', 'category' => esc_html__('Core', 'total')), 'term_thumbnails' => array('label' => esc_html__('Category Thumbnails', 'total'), 'icon' => 'dashicons dashicons-format-image', 'category' => esc_html__('Core', 'total')), 'editor_formats' => array('label' => esc_html__('Editor Formats', 'total'), 'icon' => 'dashicons dashicons-editor-paste-word', 'category' => esc_html__('Core', 'total')), 'editor_shortcodes' => array('label' => esc_html__('Editor Shortcodes', 'total'), 'icon' => 'dashicons dashicons-editor-paste-word', 'category' => esc_html__('Core', 'total')), 'remove_emoji_scripts' => array('label' => esc_html__('Remove Emoji Scripts', 'total'), 'icon' => 'dashicons dashicons-smiley', 'category' => esc_html__('Optimizations', 'total')), 'image_sizes' => array('label' => esc_html__('Image Sizes', 'total'), 'icon' => 'dashicons dashicons-image-crop', 'category' => esc_html__('Core', 'total')), 'page_animations' => array('label' => esc_html__('Page Animations', 'total'), 'icon' => 'dashicons dashicons-welcome-view-site', 'category' => esc_html__('Core', 'total')), 'typography' => array('label' => esc_html__('Typography Options', 'total'), 'icon' => 'dashicons dashicons-editor-bold', 'category' => esc_html__('Core', 'total')), 'edit_post_link' => array('label' => esc_html__('Post Edit Links', 'total'), 'icon' => 'dashicons dashicons-admin-tools', 'category' => esc_html__('Core', 'total')), 'header_image' => array('label' => esc_html__('Header Image', 'total'), 'disabled' => true, 'icon' => 'dashicons dashicons-format-image', 'category' => esc_html__('Core', 'total')), 'import_export' => array('label' => esc_html__('Import/Export Panel', 'total'), 'icon' => 'dashicons dashicons-admin-settings', 'category' => esc_html__('Core', 'total')), 'visual_composer_theme_mode' => array('label' => esc_html__('Visual Composer Theme Mode', 'total'), 'icon' => 'dashicons dashicons-admin-customizer', 'custom_id' => true, 'condition' => WPEX_VC_ACTIVE, 'category' => esc_html__('Visual Composer', 'total')), 'extend_visual_composer' => array('label' => WPEX_THEME_BRANDING . ' ' . esc_html__('Visual Composer Modules', 'total'), 'icon' => 'dashicons dashicons-admin-customizer', 'custom_id' => true, 'condition' => WPEX_VC_ACTIVE, 'category' => esc_html__('Visual Composer', 'total')), 'disable_gs' => array('disabled' => true, 'label' => esc_html__('Remove Google Fonts', 'total'), 'custom_id' => true, 'icon' => 'dashicons dashicons-thumbs-down', 'category' => esc_html__('Optimizations', 'total')), 'remove_posttype_slugs' => array('disabled' => true, 'label' => esc_html__('Remove Post Type Slugs', 'total'), 'desc' => esc_html__('Removes the slug from built-in custom post types. Slugs are important to prevent conflicts so use with caution (not recommented in most cases).', 'total'), 'custom_id' => true, 'icon' => 'dashicons dashicons-art', 'category' => esc_html__('Post Types', 'total')))); // Add panel menu add_action('admin_menu', array($this, 'add_menu_page'), 0); // Add panel submenu add_action('admin_menu', array($this, 'add_menu_subpage')); // Add custom CSS for the theme panel add_action('admin_print_styles-toplevel_page_wpex-panel', array($this, 'css')); // Register panel settings add_action('admin_init', array($this, 'register_settings')); // Load addon files $this->load_addons(); }
/** * Start things up * * @since 3.0.0 */ public function __construct() { // Check if the customizer admin panel is enabled $this->admin_enabled = wpex_get_mod('customizer_panel_enable', true); // Apply filters to $remove_default_mods var so users can run this function if they want $this->remove_default_mods - apply_filters('wpex_remove_default_mods', false); // Add admin panel if enabled if (is_admin() && $this->admin_enabled) { add_action('admin_menu', array($this, 'add_admin_page'), 40); add_action('admin_init', array($this, 'admin_options')); add_action('admin_print_styles-' . WPEX_ADMIN_PANEL_HOOK_PREFIX . '-customizer', array($this, 'admin_styles'), 40); } // Create an array of registered theme customizer panels $this->panels = apply_filters('wpex_customizer_panels', array('general' => array('title' => esc_html__('General Theme Options', 'total')), 'layout' => array('title' => esc_html__('Layout', 'total')), 'typography' => array('title' => esc_html__('Typography', 'total')), 'togglebar' => array('title' => esc_html__('Toggle Bar', 'total'), 'is_section' => true), 'topbar' => array('title' => esc_html__('Top Bar', 'total')), 'header' => array('title' => esc_html__('Header', 'total')), 'sidebar' => array('title' => esc_html__('Sidebar', 'total'), 'is_section' => true), 'blog' => array('title' => esc_html__('Blog', 'total')), 'portfolio' => array('title' => wpex_get_portfolio_name(), 'condition' => WPEX_PORTFOLIO_IS_ACTIVE), 'staff' => array('title' => wpex_get_staff_name(), 'condition' => WPEX_STAFF_IS_ACTIVE), 'testimonials' => array('title' => wpex_get_testimonials_name(), 'condition' => WPEX_TESTIMONIALS_IS_ACTIVE, 'is_section' => true), 'woocommerce' => array('title' => esc_html__('WooCommerce', 'total'), 'condition' => WPEX_WOOCOMMERCE_ACTIVE), 'callout' => array('title' => esc_html__('Callout', 'total'), 'is_section' => true), 'footer_widgets' => array('title' => esc_html__('Footer Widgets', 'total'), 'is_section' => true), 'footer_bottom' => array('title' => esc_html__('Footer Bottom', 'total'), 'is_section' => true), 'visual_composer' => array('title' => esc_html__('Visual Composer', 'total'), 'is_section' => true, 'condition' => WPEX_VC_ACTIVE))); // Get enabled panels $this->enabled_panels = get_option('wpex_customizer_panels', $this->panels); // Everything else is only needed on front end of if in the customizer if (!is_admin() || is_customize_preview()) { // Define location vars $this->customizer_dir_uri = WPEX_FRAMEWORK_DIR_URI . 'customizer/'; $this->customizer_dir = WPEX_FRAMEWORK_DIR . 'customizer/'; // Add sections (stores all sections in array if not already saved in DB) if (!$this->sections) { $this->add_sections(); } // Add custom controls and callbacks add_action('customize_register', array($this, 'controls_callbacks')); // Remove core panels and sections add_action('customize_register', array($this, 'remove_core_sections'), 11); // Add theme customizer sections and panels add_action('customize_register', array($this, 'add_customizer_panels_sections'), 40); // Adds CSS for customizer custom controls add_action('customize_controls_print_styles', array($this, 'customize_controls_print_styles')); // Load JS file for customizer add_action('customize_preview_init', array($this, 'customize_preview_init')); // CSS output if (is_customize_preview() && $this->enable_postMessage) { add_action('wp_head', array($this, 'live_preview_styles'), 999); } else { add_action('wpex_head_css', array($this, 'head_css'), 999); } } }