Пример #1
0
 /**
  * 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();
 }
Пример #2
0
 /**
  * Register post type
  *
  * @since 2.0.0
  */
 public function register_post_type()
 {
     // Get values and sanitize
     $name = wpex_get_testimonials_name();
     $singular_name = wpex_get_testimonials_singular_name();
     $slug = wpex_get_mod('testimonials_slug');
     $slug = $slug ? esc_html($slug) : 'testimonial';
     $menu_icon = wpex_get_testimonials_menu_icon();
     $testimonials_search = wpex_get_mod('testimonials_search', true);
     $testimonials_search = !$testimonials_search ? true : false;
     // Define args and apply filters
     $args = apply_filters('wpex_testimonials_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 Testimonials 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, 'capability_type' => 'post', 'has_archive' => false, 'menu_icon' => 'dashicons-' . $menu_icon, 'menu_position' => 20, 'exclude_from_search' => $testimonials_search, 'rewrite' => array('slug' => $slug), 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'revisions', 'author', 'page-attributes')));
     // Register the post type
     register_post_type('testimonials', $args);
 }
Пример #3
0
        /**
         * Adds CSS for customizer custom controls
         *
         * @since 3.0.0
         */
        public static function customize_controls_print_styles()
        {
            // Get post type icons
            $portfolio_icon = wpex_dashicon_css_content(wpex_get_portfolio_menu_icon());
            $staff_icon = wpex_dashicon_css_content(wpex_get_staff_menu_icon());
            $testimonials_icon = wpex_dashicon_css_content(wpex_get_testimonials_menu_icon());
            ?>
			
			 <style type="text/css" id="wpex-customizer-controls-css">

				/* Icons */
				#accordion-panel-wpex_general > h3:before,
				#accordion-panel-wpex_typography > h3:before,
				#accordion-panel-wpex_layout > h3:before,
				#accordion-section-wpex_togglebar > h3:before,
				#accordion-panel-wpex_topbar > h3:before,
				#accordion-panel-wpex_header > h3:before,
				#accordion-section-wpex_sidebar > h3:before,
				#accordion-panel-wpex_blog > h3:before,
				#accordion-panel-wpex_portfolio > h3:before,
				#accordion-panel-wpex_staff > h3:before,
				#accordion-section-wpex_testimonials > h3:before,
				#accordion-section-wpex_callout > h3:before,
				#accordion-section-wpex_footer_widgets > h3:before,
				#accordion-section-wpex_footer_bottom > h3:before,
				#accordion-section-wpex_visual_composer > h3:before,
				#accordion-panel-wpex_woocommerce > h3:before { display: inline-block; width: 20px; height: 20px; font-size: 20px; line-height: 1; font-family: dashicons; text-decoration: inherit; font-weight: 400; font-style: normal; vertical-align: top; text-align: center; -webkit-transition: color .1s ease-in 0; transition: color .1s ease-in 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #298cba; margin-right: 10px; font-family: "dashicons"; content: "\f108"; }

				#accordion-panel-wpex_typography > h3:before { content: "\f215" }
				#accordion-panel-wpex_layout > h3:before { content: "\f535" }
				#accordion-section-wpex_togglebar > h3:before { content: "\f132" }
				#accordion-panel-wpex_topbar > h3:before { content: "\f157" }
				#accordion-panel-wpex_header > h3:before { content: "\f175" }
				#accordion-section-wpex_sidebar > h3:before { content: "\f135" }
				#accordion-panel-wpex_blog > h3:before { content: "\f109" }
				#accordion-panel-wpex_portfolio > h3:before { content: "\<?php 
            echo esc_attr($portfolio_icon);
            ?>
" }
				#accordion-panel-wpex_staff > h3:before { content: "\<?php 
            echo esc_attr($staff_icon);
            ?>
" }
				#accordion-section-wpex_testimonials > h3:before { content: "\<?php 
            echo esc_attr($testimonials_icon);
            ?>
" }
				#accordion-section-wpex_callout > h3:before { content: "\f488" }
				#accordion-section-wpex_footer_widgets > h3:before { content: "\f209" }
				#accordion-section-wpex_footer_bottom > h3:before { content: "\f209"; }
				#accordion-section-wpex_visual_composer > h3:before { content: "\f540" }
				#accordion-panel-wpex_woocommerce > h3:before { content: "\f174" }

				/* General Tweaks */
				.customize-control-select select { min-width: 100% }

				/* Social Widgets */
				.wpex-social-widget-services-list { padding-top: 10px; }
				.wpex-social-widget-services-list li { background: #fafafa; padding: 10px; border: 1px solid #e5e5e5; margin-bottom: 10px; }
				.wpex-social-widget-services-list li p { margin: 0 }
				.wpex-social-widget-services-list li label { margin-bottom: 3px; display: block; color: #222; }
				.wpex-social-widget-services-list li label span.fa { margin-right: 10px }

				/* Slider UI */
				li.customize-control.customize-control-wpex_slider_ui input[type=text] { width: 20%; float: left; text-align: center; }
				li.customize-control.customize-control-wpex_slider_ui .ui-slider-horizontal.wpex-slider-ui { float: right; width: 75%; height: 5px; margin-top: 10px; color: #333; position: relative; border-radius: 5px; border: 1px solid #747474; border-bottom-color: #aeaeae; background-color: #cdcdcd; background: -webkit-linear-gradient(#aaaaaa, #cdcdcd); background: -o-linear-gradient(#aaaaaa, #cdcdcd); background: -moz-linear-gradient(#aaaaaa, #cdcdcd); background: linear-gradient(#aaaaaa, #cdcdcd); }
				li.customize-control.customize-control-wpex_slider_ui .ui-slider-horizontal .ui-slider-handle { position: absolute; z-index: 2; width: 17px; height: 17px; cursor: default; top: -7px; margin-left: -10px; border-radius: 50%; border: 1px solid #9e9e9e; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07); box-shadow: inset 0 1px 2px rgba(0,0,0,.07); cursor: pointer; background-color: #f5f5f5; background: -webkit-linear-gradient(#f8f8f8, #ededed); background: -o-linear-gradient(#f8f8f8, #ededed); background: -moz-linear-gradient(#f8f8f8, #ededed); background: linear-gradient(#f8f8f8, #ededed); box-shadow: 0 2px 2px rgba(0,0,0,0.24); }

				/* Sortable */
				.wpex-sortable ul { margin-top: 10px }
				.wpex-sortable li.wpex-sortable-li { cursor: move; background: #fff; padding: 0; padding-left: 15px; height: 40px; line-height: 40px; white-space: nowrap; border: 1px solid #dfdfdf; text-overflow: ellipsis; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; color: #222; margin-bottom: 5px; margin-top: 0; overflow: hidden; position: relative; }
				.wpex-sortable li.wpex-sortable-li:hover { border-color: #999; z-index: 10; }
				.wpex-sortable li.wpex-sortable-li .fa { display: block; position: absolute; top: 0; right: 0; width: 42px; height: 40px; line-height: 40px; margin: 0; color: #5cb85c; text-align: center; font-size: 18px; }
				.wpex-sortable li.wpex-sortable-li .wpex-hide-sortee { cursor: pointer }
				.wpex-sortable ul li:last-child { margin-bottom: 0 }
				.wpex-sortable li.wpex-hide .fa { color: #d9534f; }
				.wpex-sortable li.wpex-hide { opacity: 0.65; }

				/* Custom Heading */
				.wpex-customizer-heading { display: block; padding-top: 30px; padding-bottom: 5px; border-bottom: 1px solid #ddd; font-size: 16px; font-weight: bold; }

			 </style>

		<?php 
        }