From 9de5c04a0dd668589ca7cf2563ffbf01413c3f08 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Fri, 23 Apr 2021 17:58:25 -0300 Subject: [PATCH 01/32] =?UTF-8?q?Altera=C3=A7=C3=B5es=20m=C3=ADnimas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/extras.php | 2 -- sidebar-page.php | 3 ++- sidebar.php | 3 ++- style.css | 2 +- template-parts/content-page.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/extras.php b/inc/extras.php index 581a6b1..c79036c 100644 --- a/inc/extras.php +++ b/inc/extras.php @@ -132,7 +132,6 @@ function coletivo_reset_actions_required () { * * @author Everaldo Matias * @since 23/04/1987 - * */ add_action( 'after_switch_theme', 'coletivo_initial_config' ); function coletivo_initial_config() { @@ -174,7 +173,6 @@ function coletivo_initial_config() { * @author Everaldo Matias * @since 23/04/1987 * @see coletivo_initial_config() function - * */ function coletivo_remove_config () { diff --git a/sidebar-page.php b/sidebar-page.php index 1c10ece..1381669 100644 --- a/sidebar-page.php +++ b/sidebar-page.php @@ -1,9 +1,10 @@ diff --git a/functions.php b/functions.php index f0b69ef..a968f0f 100644 --- a/functions.php +++ b/functions.php @@ -1,13 +1,39 @@ esc_html__( 'Primary Menu', 'coletivo' ), - 'secondary' => esc_html__( 'Page Menu', 'coletivo' ), - ) ); + register_nav_menus( + array( + 'primary' => esc_html__( 'Primary Menu', 'coletivo' ), + 'secondary' => esc_html__( 'Page Menu', 'coletivo' ), + ) + ); /* * 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', - ) ); + add_theme_support( + 'html5', + array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) + ); /* * This theme styles the visual editor to resemble the theme style. @@ -82,24 +113,27 @@ function coletivo_setup() { */ add_theme_support( 'woocommerce' ); - /** - * Add theme Support custom logo - * @since WP 4.5 - * @sin 1.2.1 - */ - add_theme_support( 'custom-logo', array( - 'height' => 36, - 'width' => 160, - 'flex-height' => true, - 'flex-width' => true, - //'header-text' => array( 'site-title', 'site-description' ), // - ) ); + /** + * Add theme Support custom logo + * + * @since WP 4.5 + * @since 1.2.1 + */ + add_theme_support( + 'custom-logo', + array( + 'height' => 36, + 'width' => 160, + 'flex-height' => true, + 'flex-width' => true, + ) + ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); } -endif; +} add_action( 'after_setup_theme', 'coletivo_setup' ); /** @@ -120,59 +154,60 @@ function coletivo_content_width() { add_action( 'after_setup_theme', 'coletivo_content_width', 0 ); /** -* Add theme support for Portfolio Custom Post Type. -*/ -add_action( 'after_setup_theme', 'slug_jetpack_portfolio_cpt' ); + * Add theme support for Portfolio Custom Post Type. + */ function slug_jetpack_portfolio_cpt() { add_theme_support( 'jetpack-portfolio' ); } +add_action( 'after_setup_theme', 'slug_jetpack_portfolio_cpt' ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ -add_action( 'widgets_init', 'coletivo_widgets_init' ); function coletivo_widgets_init() { register_sidebar( - array( - 'name' => esc_html__( 'Sidebar', 'coletivo' ), - 'id' => 'sidebar-1', - 'description' => esc_html__('Default sidebar for blog template', 'coletivo'), - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) ); + 'name' => esc_html__( 'Sidebar', 'coletivo' ), + 'id' => 'sidebar-1', + 'description' => esc_html__( 'Default sidebar for blog template', 'coletivo' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) + ); register_sidebar( array( - 'name' => esc_html__( 'Page', 'coletivo' ), - 'id' => 'sidebar-2', - 'description' => esc_html__('Sidebar for template With Sidebar', 'coletivo'), - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) ); + 'name' => esc_html__( 'Page', 'coletivo' ), + 'id' => 'sidebar-2', + 'description' => esc_html__( 'Sidebar for template With Sidebar', 'coletivo' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) + ); } +add_action( 'widgets_init', 'coletivo_widgets_init' ); /** * Enqueue scripts and styles. */ function coletivo_scripts() { - // Check if a child theme or a plugin disable default fonts + // Check if a child theme or a plugin disable default fonts. if ( true === apply_filters( 'coletivo_load_default_fonts', true ) ) { - wp_enqueue_style( 'coletivo-fonts', coletivo_fonts_url(), array(), null ); + wp_enqueue_style( 'coletivo-fonts', coletivo_fonts_url(), array(), VERSION ); } - wp_enqueue_style( 'coletivo-animate', get_template_directory_uri() .'/assets/css/animate.min.css', array(), '1.0.0' ); - wp_enqueue_style( 'coletivo-fa', get_template_directory_uri() .'/assets/css/font-awesome.min.css', array(), '4.4.0' ); - wp_enqueue_style( 'coletivo-bootstrap', get_template_directory_uri() .'/assets/css/bootstrap.min.css', false, '4.0.0' ); - wp_enqueue_style( 'coletivo-style', get_template_directory_uri().'/style.css' ); + wp_enqueue_style( 'coletivo-animate', get_template_directory_uri() . '/assets/css/animate.min.css', array(), '1.0.0' ); + wp_enqueue_style( 'coletivo-fa', get_template_directory_uri() . '/assets/css/font-awesome.min.css', array(), '4.4.0' ); + wp_enqueue_style( 'coletivo-bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css', false, '4.0.0' ); + wp_enqueue_style( 'coletivo-style', get_template_directory_uri() . '/style.css', false, VERSION ); if ( is_child_theme() ) { - wp_enqueue_style( 'coletivo-style-child', get_stylesheet_directory_uri() .'/style.css' ); + wp_enqueue_style( 'coletivo-style-child', get_stylesheet_directory_uri() . '/style.css', false, VERSION ); } wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'coletivo-js-plugins', get_template_directory_uri() . '/assets/js/plugins.js', array(), '1.0.0', true ); @@ -187,108 +222,114 @@ function coletivo_scripts() { 'coletivo_disable_animation' => get_theme_mod( 'coletivo_animation_disable' ), 'coletivo_disable_sticky_header' => get_theme_mod( 'coletivo_sticky_header_disable' ), 'coletivo_vertical_align_menu' => get_theme_mod( 'coletivo_vertical_align_menu' ), - 'hero_animation' => get_theme_mod( 'coletivo_hero_option_animation', 'flipInX' ), - 'hero_speed' => intval( get_theme_mod( 'coletivo_hero_option_speed', 5000 ) ), + 'hero_animation' => get_theme_mod( 'coletivo_hero_option_animation', 'flipInX' ), + 'hero_speed' => intval( get_theme_mod( 'coletivo_hero_option_speed', 5000 ) ), ); wp_localize_script( 'jquery', 'coletivo_js_settings', $coletivo_js_settings ); - // Load gallery scripts - $galley_disable = get_theme_mod( 'coletivo_gallery_disable' ) == 1 ? true : false; - if ( ! $galley_disable || is_customize_preview() ) { - $coletivo_js_settings['gallery_enable'] = 1; - $display = get_theme_mod( 'coletivo_gallery_display', 'grid' ); - if ( ! is_customize_preview() ) { - switch ( $display ) { - case 'masonry': - wp_enqueue_script('coletivo-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js'); - break; - case 'justified': - wp_enqueue_script('coletivo-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js'); - break; - case 'slider': - case 'carousel': - wp_enqueue_script('coletivo-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js'); - break; - default: - break; - } - } else { - wp_enqueue_script('coletivo-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js'); - wp_enqueue_script('coletivo-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js'); - wp_enqueue_script('coletivo-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js'); - } - - } - - wp_enqueue_style( 'coletivo-gallery-lightgallery', get_template_directory_uri().'/assets/css/lightgallery.css' ); - wp_enqueue_script( 'coletivo-theme', get_template_directory_uri() . '/assets/js/theme.js' ); + // Load gallery scripts. + $galley_disable = 1 === get_theme_mod( 'coletivo_gallery_disable' ) ? true : false; + if ( ! $galley_disable || is_customize_preview() ) { + + $coletivo_js_settings['gallery_enable'] = 1; + + $display = get_theme_mod( 'coletivo_gallery_display', 'grid' ); + + if ( ! is_customize_preview() ) { + switch ( $display ) { + case 'masonry': + wp_enqueue_script( 'coletivo-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js', array(), VERSION, true ); + break; + case 'justified': + wp_enqueue_script( 'coletivo-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js', array(), VERSION, true ); + break; + case 'slider': + case 'carousel': + wp_enqueue_script( 'coletivo-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array(), VERSION, true ); + break; + default: + break; + } + } else { + wp_enqueue_script( 'coletivo-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js', array(), VERSION, true ); + wp_enqueue_script( 'coletivo-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js', array(), VERSION, true ); + wp_enqueue_script( 'coletivo-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array(), VERSION, true ); + } + } + + wp_enqueue_style( 'coletivo-gallery-lightgallery', get_template_directory_uri() . '/assets/css/lightgallery.css', false, VERSION ); + wp_enqueue_script( 'coletivo-theme', get_template_directory_uri() . '/assets/js/theme.js', array(), VERSION, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } - if ( is_front_page() && is_page_template( 'template-frontpage.php' ) ) { - if ( get_theme_mod( 'coletivo_header_scroll_logo' ) ) { - $coletivo_js_settings['is_home'] = 1; - } - } + if ( is_front_page() && is_page_template( 'template-frontpage.php' ) ) { + if ( get_theme_mod( 'coletivo_header_scroll_logo' ) ) { + $coletivo_js_settings['is_home'] = 1; + } + } wp_localize_script( 'jquery', 'coletivo_js_settings', $coletivo_js_settings ); } add_action( 'wp_enqueue_scripts', 'coletivo_scripts' ); -if ( ! function_exists( 'coletivo_fonts_url' ) ) : +if ( ! function_exists( 'coletivo_fonts_url' ) ) { /** * Register default Google fonts */ function coletivo_fonts_url() { - $fonts_url = ''; + $fonts_url = ''; - /* Translators: If there are characters in your language that are not - * supported by Open Sans, translate this to 'off'. Do not translate - * into your own language. - */ - $open_sans = _x( 'on', 'Open Sans font: on or off', 'coletivo' ); + /* + * Translators: If there are characters in your language that are not + * supported by Open Sans, translate this to 'off'. Do not translate + * into your own language. + */ + $open_sans = _x( 'on', 'Open Sans font: on or off', 'coletivo' ); - /* Translators: If there are characters in your language that are not - * supported by Raleway, translate this to 'off'. Do not translate - * into your own language. - */ - $raleway = _x( 'on', 'Raleway font: on or off', 'coletivo' ); + /* + * Translators: If there are characters in your language that are not + * supported by Raleway, translate this to 'off'. Do not translate + * into your own language. + */ + $raleway = _x( 'on', 'Raleway font: on or off', 'coletivo' ); - if ( 'off' !== $raleway || 'off' !== $open_sans ) { - $font_families = array(); + if ( 'off' !== $raleway || 'off' !== $open_sans ) { + $font_families = array(); - if ( 'off' !== $raleway ) { - $font_families[] = 'Raleway:400,500,600,700,300,100,800,900'; - } + if ( 'off' !== $raleway ) { + $font_families[] = 'Raleway:400,500,600,700,300,100,800,900'; + } - if ( 'off' !== $open_sans ) { - $font_families[] = 'Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic'; - } + if ( 'off' !== $open_sans ) { + $font_families[] = 'Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic'; + } - $query_args = array( - 'family' => urlencode( implode( '|', $font_families ) ), - 'subset' => urlencode( 'latin,latin-ext' ), - ); + $query_args = array( + 'family' => rawurlencode( implode( '|', $font_families ) ), + 'subset' => rawurlencode( 'latin,latin-ext' ), + ); - $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); - } + $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); + } - return esc_url_raw( $fonts_url ); + return esc_url_raw( $fonts_url ); } -endif; +} -if ( ! function_exists( 'coletivo_admin_scripts' ) ) : +if ( ! function_exists( 'coletivo_admin_scripts' ) ) { /** * Enqueue scripts for admin page only: Theme info page + * + * @param string $hook The hook. */ function coletivo_admin_scripts( $hook ) { - if ( $hook === 'widgets.php' || $hook === 'appearance_page_ft_coletivo' ) { - wp_enqueue_style( 'coletivo-admin-css', get_template_directory_uri() . '/assets/css/admin.css' ); + if ( 'widgets.php' === $hook || 'appearance_page_ft_coletivo' === $hook ) { + wp_enqueue_style( 'coletivo-admin-css', get_template_directory_uri() . '/assets/css/admin.css', false, VERSION ); } } -endif; +} add_action( 'admin_enqueue_scripts', 'coletivo_admin_scripts' ); /** diff --git a/header.php b/header.php index 8b8a5bd..f42f02c 100644 --- a/header.php +++ b/header.php @@ -6,10 +6,11 @@ * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * - * @package coletivo + * @package Coletivo */ -?> +?> + > @@ -20,14 +21,15 @@ > +
- + diff --git a/home.php b/home.php index 42b9bd4..e997a05 100644 --- a/home.php +++ b/home.php @@ -8,9 +8,10 @@ * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#front-page-display * - * @package coletivo + * @package Coletivo */ -$blog_style = get_theme_mod( 'coletivo_blog_page_style', 'grid' ); + +$blog_style = get_theme_mod( 'coletivo_blog_page_style', 'grid' ); $container_class = 'container'; if ( 'list' === $blog_style ) { $container_class = 'container right-sidebar'; @@ -23,55 +24,54 @@

- - + + - + -
+
- - - +

- - - - - - + /* Start the Loop */ + while ( have_posts() ) { + the_post(); - + /* + * Include the Post-Format-specific template for the content. + * If you want to override this in a child theme, then include a file + * called content-___.php (where ___ is the Post Format name) and that will be used instead. + */ + get_template_part( 'template-parts/content', get_post_format() ); + } - + the_posts_navigation(); - + } else { + get_template_part( 'template-parts/content', 'none' ); + } + ?>
- \ No newline at end of file + diff --git a/index.php b/index.php index b2f4c7d..73b65a1 100644 --- a/index.php +++ b/index.php @@ -9,50 +9,52 @@ * * @link https://codex.wordpress.org/Template_Hierarchy * - * @package coletivo + * @package Coletivo */ -get_header(); ?> - - - - +get_header(); + +if ( function_exists( 'coletivo_breadcrumb' ) ) { + echo coletivo_breadcrumb(); +} +?>
- \ No newline at end of file + diff --git a/page.php b/page.php index 25f0823..306f2d2 100644 --- a/page.php +++ b/page.php @@ -9,34 +9,36 @@ * * @link https://codex.wordpress.org/Template_Hierarchy * - * @package coletivo + * @package Coletivo */ -get_header(); ?> +get_header() +?>
- - + +
<?php the_title(); ?>
- - + +
- + ', '' ); ?>
@@ -46,4 +48,4 @@
- diff --git a/search.php b/search.php index bb60139..f1554fe 100644 --- a/search.php +++ b/search.php @@ -4,10 +4,11 @@ * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result * - * @package coletivo + * @package Coletivo */ -get_header(); ?> +get_header(); +?>
@@ -22,29 +23,29 @@
- + - + /* Start the Loop */ + while ( have_posts() ) { + the_post(); - + } - + the_posts_navigation(); - + } else { - + get_template_part( 'template-parts/content', 'none' ); - - - + } + ?>
diff --git a/single-jetpack-portfolio.php b/single-jetpack-portfolio.php index 3e471ab..79466b5 100755 --- a/single-jetpack-portfolio.php +++ b/single-jetpack-portfolio.php @@ -4,17 +4,18 @@ * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post * - * @package coletivo + * @package Coletivo */ -get_header(); ?> +get_header(); +?>
- +
- +
- +
@@ -31,11 +32,13 @@
- + - - + } // End of the loop. + ?>
diff --git a/single.php b/single.php index 4726d8d..36f316e 100644 --- a/single.php +++ b/single.php @@ -4,19 +4,20 @@ * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post * - * @package coletivo + * @package Coletivo */ -get_header(); ?> +get_header(); +?>
- +
<?php the_title(); ?>
- - + +
- diff --git a/template-frontpage.php b/template-frontpage.php index 8e75087..f4968db 100644 --- a/template-frontpage.php +++ b/template-frontpage.php @@ -4,51 +4,51 @@ * * @link https://developer.wordpress.org/themes/template-files-section/page-template-files/ * - * @package coletivo + * @package Coletivo */ -get_header(); ?> +get_header(); +?>
-
- diff --git a/template-fullwidth.php b/template-fullwidth.php index be8cf79..7ef8c7a 100644 --- a/template-fullwidth.php +++ b/template-fullwidth.php @@ -4,32 +4,34 @@ * * @link https://developer.wordpress.org/themes/template-files-section/page-template-files/ * - * @package coletivo + * @package Coletivo */ -get_header(); ?> +get_header(); +?> - +
<?php the_title(); ?>
- +
', '' ); ?>
- +
- diff --git a/template-withsidebar.php b/template-withsidebar.php index 8f9166c..3ed1665 100644 --- a/template-withsidebar.php +++ b/template-withsidebar.php @@ -1,12 +1,12 @@ +get_header(); +?>
diff --git a/woocommerce.php b/woocommerce.php index 59e3ac2..7fccb1a 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -2,10 +2,11 @@ /** * The template for displaying all pages WooCommerce page. * - * @package coletivo + * @package Coletivo */ -get_header(); ?> +get_header(); +?>
From e58ee1ab0f1067e46284c6526bc2bd1c977792d0 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Fri, 23 Apr 2021 18:04:56 -0300 Subject: [PATCH 03/32] Coding standards nos arquivos da pasta inc - class-metabox.php; - dashboard.php; - template-tags.php. --- inc/class-metabox.php | 175 +++-- inc/dashboard.php | 352 ++++----- inc/template-tags.php | 1640 +++++++++++++++++++++-------------------- 3 files changed, 1109 insertions(+), 1058 deletions(-) diff --git a/inc/class-metabox.php b/inc/class-metabox.php index 53fd380..2cb7e83 100644 --- a/inc/class-metabox.php +++ b/inc/class-metabox.php @@ -1,13 +1,20 @@ id, $this->get_post_type() ) ) { + if ( in_array( $screen->id, $this->get_post_type(), true ) ) { // Color Picker. wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker' ); @@ -76,19 +90,19 @@ public function scripts() { wp_enqueue_script( 'jquery-ui-sortable' ); // Metabox. - wp_enqueue_script( 'odin-admin', get_template_directory_uri() . '/assets/js/admin.js', array( 'jquery' ), null, true ); - wp_enqueue_style( 'odin-admin', get_template_directory_uri() . '/assets/css/admin.css', array(), null, 'all' ); + wp_enqueue_script( 'odin-admin', get_template_directory_uri() . '/assets/js/admin.js', array( 'jquery' ), ODIN_VERSION, true ); + wp_enqueue_style( 'odin-admin', get_template_directory_uri() . '/assets/css/admin.css', array(), ODIN_VERSION, 'all' ); // Localize strings. wp_localize_script( 'odin-admin', 'odinAdminParams', array( - 'galleryTitle' => __( 'Add images in gallery', 'odin' ), - 'galleryButton' => __( 'Add in gallery', 'odin' ), - 'galleryRemove' => __( 'Remove image', 'odin' ), - 'uploadTitle' => __( 'Choose a file', 'odin' ), - 'uploadButton' => __( 'Add file', 'odin' ), + 'galleryTitle' => __( 'Add images in gallery', 'coletivo' ), + 'galleryButton' => __( 'Add in gallery', 'coletivo' ), + 'galleryRemove' => __( 'Remove image', 'coletivo' ), + 'uploadTitle' => __( 'Choose a file', 'coletivo' ), + 'uploadButton' => __( 'Add file', 'coletivo' ), ) ); } @@ -128,7 +142,7 @@ public function set_fields( $fields = array() ) { * * @param object $post Post object. * - * @return string Metabox HTML fields. + * @return void */ public function metabox( $post ) { // Use nonce for verification. @@ -138,35 +152,34 @@ public function metabox( $post ) { do_action( 'odin_metabox_header_' . $this->id, $post_id ); - echo apply_filters( 'odin_metabox_container_before_' . $this->id, '' ); + echo esc_html( apply_filters( 'odin_metabox_container_before_' . $this->id, '
' ) ); foreach ( $this->fields as $field ) { - echo apply_filters( 'odin_metabox_wrap_before_' . $this->id, '', $field ); + echo esc_html( apply_filters( 'odin_metabox_wrap_before_' . $this->id, '', $field ) ); - if ( 'title' == $field['type'] ) { + if ( 'title' === $field['type'] ) { $title = sprintf( '', $field['label'] ); - } elseif ( 'separator' == $field['type'] ) { + } elseif ( 'separator' === $field['type'] ) { $title = sprintf( '', $field['id'] ); } else { $title = sprintf( '', $field['id'], $field['label'] ); } - echo apply_filters( 'odin_metabox_field_title_' . $this->id, $title, $field ); + echo esc_html( apply_filters( 'odin_metabox_field_title_' . $this->id, $title, $field ) ); - echo apply_filters( 'odin_metabox_field_before_' . $this->id, '', $field ) ); - echo apply_filters( 'odin_metabox_field_after_' . $this->id, '', $field ); - - echo apply_filters( 'odin_metabox_wrap_after_' . $this->id, '', $field ); + echo esc_html( apply_filters( 'odin_metabox_wrap_after_' . $this->id, '', $field ) ); } - echo apply_filters( 'odin_metabox_container_after_' . $this->id, '
%s', $field ); + echo esc_html( apply_filters( 'odin_metabox_field_before_' . $this->id, '', $field ) ); $this->process_fields( $field, $post_id ); if ( isset( $field['description'] ) ) { - echo sprintf( '%s', $field['description'] ); + echo esc_html( sprintf( '%s', $field['description'] ) ); } + echo esc_html( apply_filters( 'odin_metabox_field_after_' . $this->id, '
' ); + echo esc_html( apply_filters( 'odin_metabox_container_after_' . $this->id, '' ) ); do_action( 'odin_metabox_footer_' . $this->id, $post_id ); @@ -175,10 +188,10 @@ public function metabox( $post ) { /** * Process the metabox fields. * - * @param array $args Field arguments + * @param array $args Field arguments. * @param int $post_id ID of the current post type. * - * @return string HTML of the field. + * @return void */ protected function process_fields( $args, $post_id ) { $id = $args['id']; @@ -259,14 +272,14 @@ protected function build_field_attributes( $attrs ) { * @param string $current Field current value. * @param array $attrs Array with field attributes. * - * @return string HTML of the field. + * @return void */ protected function field_input( $id, $current, $attrs ) { if ( ! isset( $attrs['type'] ) ) { $attrs['type'] = 'text'; } - echo sprintf( '', $id, esc_attr( $current ), $this->build_field_attributes( $attrs ) ); + echo sprintf( '', esc_attr( $id ), esc_attr( $current ), esc_attr( $this->build_field_attributes( $attrs ) ) ); } /** @@ -276,7 +289,7 @@ protected function field_input( $id, $current, $attrs ) { * @param string $current Field current value. * @param array $attrs Array with field attributes. * - * @return string HTML of the field. + * @return void */ protected function field_textarea( $id, $current, $attrs ) { if ( ! isset( $attrs['cols'] ) ) { @@ -287,7 +300,7 @@ protected function field_textarea( $id, $current, $attrs ) { $attrs['rows'] = '5'; } - echo sprintf( '', $id, esc_attr( $current ), $this->build_field_attributes( $attrs ) ); + echo sprintf( '', esc_attr( $id ), esc_attr( $current ), esc_attr( $this->build_field_attributes( $attrs ) ) ); } /** @@ -297,10 +310,10 @@ protected function field_textarea( $id, $current, $attrs ) { * @param string $current Field current value. * @param array $attrs Array with field attributes. * - * @return string HTML of the field. + * @return void */ protected function field_checkbox( $id, $current, $attrs ) { - echo sprintf( '', $id, checked( 1, $current, false ), $this->build_field_attributes( $attrs ) ); + echo sprintf( '', esc_attr( $id ), esc_attr( checked( 1, $current, false ) ), esc_attr( $this->build_field_attributes( $attrs ) ) ); } /** @@ -311,22 +324,22 @@ protected function field_checkbox( $id, $current, $attrs ) { * @param array $options Array with select options. * @param array $attrs Array with field attributes. * - * @return string HTML of the field. + * @return void */ protected function field_select( $id, $current, $options, $attrs ) { // If multiple add a array in the option. - $multiple = ( in_array( 'multiple', $attrs ) ) ? '[]' : ''; + $multiple = ( in_array( 'multiple', $attrs, true ) ) ? '[]' : ''; $html = sprintf( ''; - echo $html; + echo esc_html( $html ); } /** @@ -339,15 +352,15 @@ protected function field_select( $id, $current, $options, $attrs ) { */ protected function is_selected( $current, $key ) { $selected = false; - if( is_array( $current ) ) { - for( $i = 0; $i < count( $current ); $i++ ) { - if( selected( $current[ $i ], $key, false ) ) { + if ( is_array( $current ) ) { + $count = count( $current ); + for ( $i = 0; $i < $count; $i++ ) { + if ( selected( $current[ $i ], $key, false ) ) { $selected = selected( $current[ $i ], $key, false ); break 1; } } - } - else { + } else { $selected = selected( $current, $key, false ); } @@ -362,15 +375,16 @@ protected function is_selected( $current, $key ) { * @param array $options Array with input options. * @param array $attrs Array with field attributes. * - * @return string HTML of the field. + * @return void */ protected function field_radio( $id, $current, $options, $attrs ) { $html = ''; - foreach ( $options as $key => $label ) + foreach ( $options as $key => $label ) { $html .= sprintf( '
', $id, $key, checked( $current, $key, false ), $label, $this->build_field_attributes( $attrs ) ); + } - echo $html; + echo esc_html( $html ); } /** @@ -380,7 +394,7 @@ protected function field_radio( $id, $current, $options, $attrs ) { * @param string $current Field current value. * @param array $options Array with wp_editor options. * - * @return string HTML of the field. + * @return void */ protected function field_editor( $id, $current, $options ) { // Set default options. @@ -388,7 +402,7 @@ protected function field_editor( $id, $current, $options ) { $options = array( 'textarea_rows' => 10 ); } - $options[ 'textarea_name' ] = $id; + $options['textarea_name'] = $id; echo '
'; wp_editor( wpautop( $current ), $id, $options ); @@ -402,10 +416,10 @@ protected function field_editor( $id, $current, $options ) { * @param string $current Field current value. * @param array $attrs Array with field attributes. * - * @return string HTML of the field. + * @return void */ protected function field_upload( $id, $current, $attrs ) { - echo sprintf( ' ', $id, esc_url( $current ), __( 'Select file', 'odin' ), $this->build_field_attributes( $attrs ) ); + echo sprintf( ' ', esc_attr( $id ), esc_attr( $current ), esc_attr__( 'Select file', 'odin' ), esc_attr( $this->build_field_attributes( $attrs ) ) ); } /** @@ -414,14 +428,14 @@ protected function field_upload( $id, $current, $attrs ) { * @param string $id Field id. * @param string $current Field current value. * - * @return string HTML of the field. + * @return void */ protected function field_image( $id, $current ) { // Gets placeholder image. $image = get_template_directory_uri() . '/assets/images/placeholder.png'; $html = '
'; - $html .= '' . $image . ''; + $html .= '' . $image . ''; if ( $current ) { $image = wp_get_attachment_image_src( $current, 'thumbnail' ); @@ -433,7 +447,7 @@ protected function field_image( $id, $current ) { $html .= '
'; $html .= '
'; - echo $html; + echo esc_html( $html ); } /** @@ -442,35 +456,36 @@ protected function field_image( $id, $current ) { * @param string $id Field id. * @param string $current Field current value. * - * @return string HTML of the field. + * @return void */ protected function field_image_plupload( $id, $current ) { - $html = ''; - echo $html; + echo esc_html( $html ); } /** @@ -478,11 +493,11 @@ protected function field_image_plupload( $id, $current ) { * * @param int $post_id Current post type ID. * - * @return void + * @return int */ public function save( $post_id ) { // Verify nonce. - if ( ! isset( $_POST[ $this->nonce ] ) || ! wp_verify_nonce( $_POST[ $this->nonce ], basename( __FILE__ ) ) ) { + if ( ! isset( $_POST[ $this->nonce ] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST[ $this->nonce ], basename( __FILE__ ) ) ) ) ) { return $post_id; } @@ -492,7 +507,7 @@ public function save( $post_id ) { } // Check permissions. - if ( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], $this->get_post_type() ) ) { + if ( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], $this->get_post_type(), true ) ) { if ( ! current_user_can( 'edit_page', $post_id ) ) { return $post_id; } @@ -502,16 +517,16 @@ public function save( $post_id ) { foreach ( $this->fields as $field ) { $name = $field['id']; - $value = isset( $_POST[ $name ] ) ? $_POST[ $name ] : null; + $value = isset( $_POST[ $name ] ) ? sanitize_key( wp_unslash( $_POST[ $name ] ) ) : null; - if ( ! in_array( $field['type'], array( 'separator', 'title' ) ) ) { + if ( ! in_array( $field['type'], array( 'separator', 'title' ), true ) ) { $old = get_post_meta( $post_id, $name, true ); $new = apply_filters( 'odin_save_metabox_' . $this->id, $value, $name ); - if ( $new && $new != $old ) { + if ( $new && $new !== $old ) { update_post_meta( $post_id, $name, $new ); - } elseif ( '' == $new && $old ) { + } elseif ( '' === $new && $old ) { delete_post_meta( $post_id, $name, $old ); } } diff --git a/inc/dashboard.php b/inc/dashboard.php index c6daa84..ba9b2ae 100644 --- a/inc/dashboard.php +++ b/inc/dashboard.php @@ -1,29 +1,35 @@ 0 ){ - $update_label = sprintf( _n( '%1$s action required', '%1$s actions required', $number_count, 'coletivo' ), $number_count ); - $count = "" . number_format_i18n($number_count) . ""; - $menu_title = sprintf( esc_html__('Coletivo Theme %s', 'coletivo'), $count ); - } else { - $menu_title = esc_html__('Coletivo Theme', 'coletivo'); - } - - add_theme_page( esc_html__( 'Coletivo Dashboard', 'coletivo' ), $menu_title, 'edit_theme_options', 'ft_coletivo', 'coletivo_theme_info_page'); + $actions = coletivo_get_actions_required(); + $n = array_count_values( $actions ); + $number_count = 0; + if ( $n && isset( $n['active'] ) ) { + $number_count = $n['active']; + } + + if ( $number_count > 0 ) { + $update_label = sprintf( _n( '%1$s action required', '%1$s actions required', $number_count, 'coletivo' ), $number_count ); + $count = '' . number_format_i18n( $number_count ) . ''; + $menu_title = sprintf( esc_html__( 'Coletivo Theme %s', 'coletivo' ), $count ); + } else { + $menu_title = esc_html__( 'Coletivo Theme', 'coletivo' ); + } + + add_theme_page( esc_html__( 'Coletivo Dashboard', 'coletivo' ), $menu_title, 'edit_theme_options', 'ft_coletivo', 'coletivo_theme_info_page' ); } - +add_action( 'admin_menu', 'coletivo_theme_info' ); /** * Add admin notice when active theme, just show one timetruongsa@200811 @@ -31,157 +37,173 @@ function coletivo_theme_info() { * @return bool|null */ function coletivo_admin_notice() { - if ( ! function_exists( 'coletivo_get_actions_required' ) ) { - return false; - } - $actions = coletivo_get_actions_required(); - $n = array_count_values( $actions ); - $number_action = 0; - if ( $n && isset( $n['active'] ) ) { - $number_action = $n['active']; - } - if ( $number_action > 0 ) { - $theme_data = wp_get_theme(); - ?> -
-

Welcome page', 'coletivo' ), $theme_data->Name, admin_url( 'themes.php?page=ft_coletivo' ) ); ?>

-
- 0 ) { + $theme_data = wp_get_theme(); + ?> +
+

Welcome page', 'coletivo' ), esc_html( $theme_data->Name ), esc_url( admin_url( 'themes.php?page=ft_coletivo' ) ) ); ?>

+
+ -
-

Version ); ?>

-
- ColetivoWP - - - -
-
-
- - - -
- -
- Theme Screenshot -
-
-
- - - -
- 0 ) { ?> - '', 'page_template' ) ) ?> - - - - - - - - - -

Name ); ?>

-

- -
- - - - -
- +
+

Version ) ); ?>

+
+ ColetivoWP + + + +
+
+
+ + + +
+ +
+ Theme Screenshot +
+
+
+ + + +
+ 0 ) { ?> + '', + 'page_template', + ) + ); + ?> + + + + + + + + + +

Name ) ); ?>

+

+ +
+ + + + +
+ '; - $html .= get_custom_logo(); - $html .= '
'; - } - } - - $hide_sitetile = get_theme_mod( 'coletivo_hide_sitetitle', 0 ); - $hide_tagline = get_theme_mod( 'coletivo_hide_tagline', 0 ); - - if ( ! $hide_sitetile ) { - $classes['title'] = 'has-title'; - if ( is_front_page() && !is_home() ) { - $html .= '

'; - } else { - $html .= '

'; - } - } - - if ( ! $hide_tagline ) { - $description = get_bloginfo( 'description', 'display' ); - if ( $description || is_customize_preview() ) { - $classes['desc'] = 'has-desc'; - $html .= '

'.$description.'

'; - } - } else { - $classes['desc'] = 'no-desc'; - } - - echo '
'.$html.'
'; - } + /** + * Site logo + */ + function coletivo_site_logo() { + $classes = array(); + $html = ''; + $classes['logo'] = 'no-logo-img'; + + if ( function_exists( 'has_custom_logo' ) ) { + if ( has_custom_logo() ) { + $classes['logo'] = 'has-logo-img'; + $html .= '
'; + $html .= get_custom_logo(); + $html .= '
'; + } + } + + $hide_sitetile = get_theme_mod( 'coletivo_hide_sitetitle', 0 ); + $hide_tagline = get_theme_mod( 'coletivo_hide_tagline', 0 ); + + if ( ! $hide_sitetile ) { + $classes['title'] = 'has-title'; + if ( is_front_page() && ! is_home() ) { + $html .= '

'; + } else { + $html .= '

'; + } + } + + if ( ! $hide_tagline ) { + $description = get_bloginfo( 'description', 'display' ); + if ( $description || is_customize_preview() ) { + $classes['desc'] = 'has-desc'; + $html .= '

' . $description . '

'; + } + } else { + $classes['desc'] = 'no-desc'; + } + + echo '
' . esc_html( $html ) . '
'; + } } add_action( 'coletivo_site_start', 'coletivo_site_header' ); if ( ! function_exists( 'coletivo_site_header' ) ) { - /** - * Display site header - */ - function coletivo_site_header(){ - ?> - - + + %2$s'; - if (get_the_time('U') !== get_the_modified_time('U')) { - $time_string = ''; - } - - $time_string = sprintf($time_string, - esc_attr(get_the_date('c')), - esc_html(get_the_date()), - esc_attr(get_the_modified_date('c')), - esc_html(get_the_modified_date()) - ); - - $posted_on = sprintf( - esc_html__('Posted on %s', 'coletivo','post date'), - '' . $time_string . '' - ); - - $byline = sprintf( - esc_html__('by %s', 'coletivo', 'post author'), - '' . esc_html(get_the_author()) . '' - ); - - echo '' . $posted_on . ''; // WPCS: XSS OK. - - rewind_posts(); - } + /** + * Prints HTML with meta information for the current post-date/time and author. + */ + function coletivo_posted_on() { + the_post(); + + $time_string = ''; + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = ''; + } + + $time_string = sprintf( + $time_string, + esc_attr( get_the_date( 'c' ) ), + esc_html( get_the_date() ), + esc_attr( get_the_modified_date( 'c' ) ), + esc_html( get_the_modified_date() ) + ); + + $posted_on = sprintf( + esc_html__( 'Posted on %s', 'coletivo', 'post date' ), + '' . $time_string . '' + ); + + $byline = sprintf( + esc_html__( 'by %s', 'coletivo', 'post author' ), + '' . esc_html( get_the_author() ) . '' + ); + + echo '' . $posted_on . ''; // WPCS: XSS OK. + + rewind_posts(); + } } if ( ! function_exists( 'coletivo_entry_footer' ) ) { - /** - * Prints HTML with meta information for the categories, tags and comments. - */ - function coletivo_entry_footer() - { - // Hide category and tag text for pages. - if ('post' === get_post_type()) { - /* translators: used between list items, there is a space after the comma */ - $categories_list = get_the_category_list(esc_html__(', ', 'coletivo')); - if ($categories_list && coletivo_categorized_blog()) { - printf('' . esc_html__('Posted in %1$s', 'coletivo') . '', $categories_list); // WPCS: XSS OK. - } - - /* translators: used between list items, there is a space after the comma */ - $tags_list = get_the_tag_list('', esc_html__(', ', 'coletivo')); - if ($tags_list) { - printf('' . esc_html__('Tagged %1$s', 'coletivo') . '', $tags_list); // WPCS: XSS OK. - } - } - - if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) { - echo ''; - comments_popup_link(esc_html__('Leave a comment', 'coletivo'), esc_html__('1 Comment', 'coletivo'), esc_html__('% Comments', 'coletivo')); - echo ''; - } - - } + /** + * Prints HTML with meta information for the categories, tags and comments. + */ + function coletivo_entry_footer() { + // Hide category and tag text for pages. + if ( 'post' === get_post_type() ) { + /* translators: used between list items, there is a space after the comma */ + $categories_list = get_the_category_list( esc_html__( ', ', 'coletivo' ) ); + if ( $categories_list && coletivo_categorized_blog() ) { + printf( '' . esc_html__( 'Posted in %1$s', 'coletivo' ) . '', $categories_list ); // WPCS: XSS OK. + } + + /* translators: used between list items, there is a space after the comma */ + $tags_list = get_the_tag_list( '', esc_html__( ', ', 'coletivo' ) ); + if ( $tags_list ) { + printf( '' . esc_html__( 'Tagged %1$s', 'coletivo' ) . '', $tags_list ); // WPCS: XSS OK. + } + } + + if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo ''; + comments_popup_link( esc_html__( 'Leave a comment', 'coletivo' ), esc_html__( '1 Comment', 'coletivo' ), esc_html__( '% Comments', 'coletivo' ) ); + echo ''; + } + + } } /** @@ -157,15 +168,17 @@ function coletivo_entry_footer() * @return bool */ function coletivo_categorized_blog() { - if ( false === ( $all_the_cool_cats = get_transient( 'coletivo_categories' ) ) ) { + if ( ( $all_the_cool_cats = get_transient( 'coletivo_categories' ) ) === false ) { // Create an array of all the categories that are attached to posts. - $all_the_cool_cats = get_categories( array( - 'fields' => 'ids', - 'hide_empty' => 1, + $all_the_cool_cats = get_categories( + array( + 'fields' => 'ids', + 'hide_empty' => 1, - // We only need to know if there is more than one category. - 'number' => 2, - ) ); + // We only need to know if there is more than one category. + 'number' => 2, + ) + ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); @@ -193,603 +206,603 @@ function coletivo_category_transient_flusher() { delete_transient( 'coletivo_categories' ); } add_action( 'edit_category', 'coletivo_category_transient_flusher' ); -add_action( 'save_post', 'coletivo_category_transient_flusher' ); - - -if ( ! function_exists( 'coletivo_comment' ) ) : -/** - * Template for comments and pingbacks. - * - * To override this walker in a child theme without modifying the comments template - * simply create your own coletivo_comment(), and that function will be used instead. - * - * Used as a callback by wp_list_comments() for displaying the comments. - * - * @return void - */ -function coletivo_comment( $comment, $args, $depth ) { - $GLOBALS['comment'] = $comment; - switch ( $comment->comment_type ) : - case 'pingback' : - case 'trackback' : - // Display trackbacks differently than normal comments. - ?> -
  • id="comment-"> -

    ', '' ); ?>

    - -
  • id="li-comment-"> -
    - - - -
    - -
    - %1$s %2$s', - get_comment_author_link(), - // If current post author is also comment author, make it known visually. - ( $comment->user_id === $post->post_author ) ? '' . __( 'Post author', 'coletivo' ) . '' : '' - ); - printf( '', - esc_url( get_comment_link( $comment->comment_ID ) ), - get_comment_time( 'c' ), - /* translators: 1: date, 2: time */ - sprintf( __( '%1$s', 'coletivo' ), get_comment_date() ) - ); - comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'coletivo' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); - edit_comment_link( __( 'Edit', 'coletivo' ), '', '' ); - ?> -
    - - comment_approved ) : ?> -

    - - -
    - - -
    - -
    - -
    - comment_type ) : + case 'pingback' : + case 'trackback' : + // Display trackbacks differently than normal comments. + ?> +
  • id="comment-"> +

    ', '' ); ?>

    + +
  • id="li-comment-"> +
    + + + +
    + +
    + %1$s %2$s', + get_comment_author_link(), + // If current post author is also comment author, make it known visually. + ( $comment->user_id === $post->post_author ) ? '' . __( 'Post author', 'coletivo' ) . '' : '' + ); + printf( '', + esc_url( get_comment_link( $comment->comment_ID ) ), + get_comment_time( 'c' ), + /* translators: 1: date, 2: time */ + sprintf( __( '%1$s', 'coletivo' ), get_comment_date() ) + ); + comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'coletivo' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); + edit_comment_link( __( 'Edit', 'coletivo' ), '', '' ); + ?> +
    + + comment_approved ) : ?> +

    + + +
    + +
    + +
    + +
    + $r, 'g' => $g, 'b' => $b, 'a' => $alpha ) ) . ')'; - } - - return false; - - } + /** + * Convert hex color to rgba color + * + * @since 1.1.5 + * + * @param $color + * @param int $alpha + * @return bool|string + */ + function coletivo_hex_to_rgba( $color, $alpha = 1) + { + $color = str_replace( '#', '', $color); + if ( '' === $color) { + return ''; + } + + if ( strpos(trim( $color), 'rgb' ) !== false ) { + return $color; + } + + // 3 or 6 hex digits, or the empty string. + if (preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', '#' . $color) ) { + // convert to rgb + $colour = $color; + if (strlen( $colour) == 6) { + list( $r, $g, $b) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5]); + } elseif (strlen( $colour) == 3) { + list( $r, $g, $b) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2]); + } else { + return false; + } + $r = hexdec( $r); + $g = hexdec( $g); + $b = hexdec( $b); + return 'rgba( ' . join( ',', array( 'r' => $r, 'g' => $g, 'b' => $b, 'a' => $alpha ) ) . ' )'; + } + + return false; + + } } add_action( 'wp_enqueue_scripts', 'coletivo_custom_inline_style', 100 ); if ( ! function_exists( 'coletivo_custom_inline_style' ) ) { - /** - * Add custom css to header - * - * @change 1.1.5 - */ + /** + * Add custom css to header + * + * @change 1.1.5 + */ function coletivo_custom_inline_style( ) { - /** - * Custom hero section css - */ - $hero_bg_color = get_theme_mod( 'coletivo_hero_overlay_color', '#000000' ); - - // Deprecate form v 1.1.5 - $hero_bg_color = coletivo_hex_to_rgba( $hero_bg_color, get_theme_mod( 'coletivo_hero_overlay_opacity' , .3 ) ); - - /** - * Custom featuredpage section css - */ - $featuredpage_bg_color = get_theme_mod( 'coletivo_featuredpage_overlay_color', '#000000' ); - - // Deprecate form v 1.1.5 - $featuredpage_bg_color = coletivo_hex_to_rgba( $featuredpage_bg_color, get_theme_mod( 'coletivo_featuredpage_overlay_opacity' , .3 ) ); - - ob_start(); - ?> - #main .video-section section.hero-slideshow-wrapper { - background: transparent; - } - .hero-slideshow-wrapper:after { - position: absolute; - top: 0px; - left: 0px; - width: 100%; - height: 100%; - background-color: ; - display: block; - content: ""; - } - .body-desktop .parallax-hero .hero-slideshow-wrapper:after { - display: none !important; - } - .parallax-hero .parallax-mirror:after { - position: absolute; - top: 0px; - left: 0px; - width: 100%; - height: 100%; - background-color: ; - display: block; - content: ""; - } - .parallax-hero .hero-slideshow-wrapper:after { - display: none !important; - } - .parallax-hero .parallax-mirror:after { - position: absolute; - top: 0px; - left: 0px; - width: 100%; - height: 100%; - background-color: ; - display: block; - content: ""; - } - - .section-featuredpage:before { - background-color: ; - display: block; - } - - a, .screen-reader-text:hover, .screen-reader-text:active, .screen-reader-text:focus, .header-social a, .coletivo-menu a:hover, - .coletivo-menu ul li a:hover, .coletivo-menu li.coletivo-current-item > a, .coletivo-menu ul li.current-menu-item > a, .coletivo-menu > li a.menu-actived, - .coletivo-menu.coletivo-menu-mobile li.coletivo-current-item > a, .site-footer a, .section-social a, .section-social .footer-social a:hover, .site-footer .btt a:hover, - .highlight, #comments .comment .comment-wrapper .comment-meta .comment-time:hover, #comments .comment .comment-wrapper .comment-meta .comment-reply-link:hover, #comments .comment .comment-wrapper .comment-meta .comment-edit-link:hover, - .btn-theme-primary-outline, .sidebar .widget a:hover, .section-services .service-item .service-image i, .counter_item .counter__number, - .team-member .member-thumb .member-profile a:hover, .icon-background-default - { - color: #; - } - input[type="reset"], input[type="submit"], input[type="submit"], .nav-links a:hover, .btn-theme-primary, .btn-theme-primary-outline:hover, .card-theme-primary, + /** + * Custom hero section css + */ + $hero_bg_color = get_theme_mod( 'coletivo_hero_overlay_color', '#000000' ); + + // Deprecate form v 1.1.5 + $hero_bg_color = coletivo_hex_to_rgba( $hero_bg_color, get_theme_mod( 'coletivo_hero_overlay_opacity' , .3 ) ); + + /** + * Custom featuredpage section css + */ + $featuredpage_bg_color = get_theme_mod( 'coletivo_featuredpage_overlay_color', '#000000' ); + + // Deprecate form v 1.1.5 + $featuredpage_bg_color = coletivo_hex_to_rgba( $featuredpage_bg_color, get_theme_mod( 'coletivo_featuredpage_overlay_opacity' , .3 ) ); + + ob_start(); + ?> + #main .video-section section.hero-slideshow-wrapper { + background: transparent; + } + .hero-slideshow-wrapper:after { + position: absolute; + top: 0px; + left: 0px; + width: 100%; + height: 100%; + background-color: ; + display: block; + content: ""; + } + .body-desktop .parallax-hero .hero-slideshow-wrapper:after { + display: none !important; + } + .parallax-hero .parallax-mirror:after { + position: absolute; + top: 0px; + left: 0px; + width: 100%; + height: 100%; + background-color: ; + display: block; + content: ""; + } + .parallax-hero .hero-slideshow-wrapper:after { + display: none !important; + } + .parallax-hero .parallax-mirror:after { + position: absolute; + top: 0px; + left: 0px; + width: 100%; + height: 100%; + background-color: ; + display: block; + content: ""; + } + + .section-featuredpage:before { + background-color: ; + display: block; + } + + a, .screen-reader-text:hover, .screen-reader-text:active, .screen-reader-text:focus, .header-social a, .coletivo-menu a:hover, + .coletivo-menu ul li a:hover, .coletivo-menu li.coletivo-current-item > a, .coletivo-menu ul li.current-menu-item > a, .coletivo-menu > li a.menu-actived, + .coletivo-menu.coletivo-menu-mobile li.coletivo-current-item > a, .site-footer a, .section-social a, .section-social .footer-social a:hover, .site-footer .btt a:hover, + .highlight, #comments .comment .comment-wrapper .comment-meta .comment-time:hover, #comments .comment .comment-wrapper .comment-meta .comment-reply-link:hover, #comments .comment .comment-wrapper .comment-meta .comment-edit-link:hover, + .btn-theme-primary-outline, .sidebar .widget a:hover, .section-services .service-item .service-image i, .counter_item .counter__number, + .team-member .member-thumb .member-profile a:hover, .icon-background-default + { + color: #; + } + input[type="reset"], input[type="submit"], input[type="submit"], .nav-links a:hover, .btn-theme-primary, .btn-theme-primary-outline:hover, .card-theme-primary, .woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce button.button.alt - { - background: #; - } - .btn-theme-primary-outline, .btn-theme-primary-outline:hover, .pricing__item:hover, .card-theme-primary, .entry-content blockquote - { - border-color : #; - } - - .site-header { - background: #; - border-bottom: 0px none; - } - - .coletivo-menu > li > a { - color: #; - } - - .coletivo-menu > li > a:hover, - .coletivo-menu > li.coletivo-current-item > a{ - color: #; + { + background: #; + } + .btn-theme-primary-outline, .btn-theme-primary-outline:hover, .pricing__item:hover, .card-theme-primary, .entry-content blockquote + { + border-color : #; + } + + .site-header { + background: #; + border-bottom: 0px none; + } + + .coletivo-menu > li > a { + color: #; + } + + .coletivo-menu > li > a:hover, + .coletivo-menu > li.coletivo-current-item > a{ + color: #; -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out; - } - + } + @media screen and (min-width: 1140px) { - .coletivo-menu > li:last-child > a { - padding-right: 17px; - } - .coletivo-menu > li > a:hover, - .coletivo-menu > li.coletivo-current-item > a - { - background: #; + .coletivo-menu > li:last-child > a { + padding-right: 17px; + } + .coletivo-menu > li > a:hover, + .coletivo-menu > li.coletivo-current-item > a + { + background: #; -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out; - } + } } - + * Reponsive Mobile button color + */ + $menu_button_color = get_theme_mod( 'coletivo_menu_toggle_button_color' ); + if ( $menu_button_color ) { + ?> #nav-toggle span, #nav-toggle span::before, #nav-toggle span::after, #nav-toggle.nav-is-visible span::before, #nav-toggle.nav-is-visible span::after { background: #; } - + * Site Title + */ + $coletivo_logo_text_color = get_theme_mod( 'coletivo_logo_text_color' ); + if ( $coletivo_logo_text_color ) { + ?> .site-branding .site-title, .site-branding .site-text-logo { color: #; } - - .section-social { - background-color: #; - } - .section-social .footer-connect .follow-heading { - color: rgba(255, 255, 255, 0.9); - } - - .site-footer .site-info, .site-footer .btt a{ - background-color: #; - } - .site-footer .site-info { - color: rgba(255, 255, 255, 0.7); - } - .site-footer .btt a, .site-footer .site-info a { - color: rgba(255, 255, 255, 0.9); - } - - .gallery-carousel .g-item{ - padding: 0px px; - } - .gallery-carousel { - margin-left: -px; - margin-right: -px; - } - .gallery-grid .g-item, .gallery-masonry .g-item .inner { - padding: px; - } - .gallery-grid, .gallery-masonry { - margin: -px; - } - .*?\*\/)|^\s*|\s*$#s', - // Remove unused white-space(s) - '#("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\'|\/\*(?>.*?\*\/))|\s*+;\s*+(})\s*+|\s*+([*$~^|]?+=|[{};,>~+]|\s*+-(?![0-9\.])|!important\b)\s*+|([[(:])\s++|\s++([])])|\s++(:)\s*+(?!(?>[^{}"\']++|"(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')*+{)|^\s++|\s++\z|(\s)\s+#si', - ), - array( - '$1', - '$1$2$3$4$5$6$7', - ), - $css - ); - - $custom = get_option( 'coletivo_custom_css' ); - if ( $custom ){ - $css.= "\n/* --- Begin custom CSS --- */\n". $custom."\n/* --- End custom CSS --- */\n"; - } - - wp_add_inline_style( 'coletivo-style', $css ); + + .section-social { + background-color: #; + } + .section-social .footer-connect .follow-heading { + color: rgba(255, 255, 255, 0.9); + } + + .site-footer .site-info, .site-footer .btt a{ + background-color: #; + } + .site-footer .site-info { + color: rgba(255, 255, 255, 0.7); + } + .site-footer .btt a, .site-footer .site-info a { + color: rgba(255, 255, 255, 0.9); + } + + .gallery-carousel .g-item{ + padding: 0px px; + } + .gallery-carousel { + margin-left: -px; + margin-right: -px; + } + .gallery-grid .g-item, .gallery-masonry .g-item .inner { + padding: px; + } + .gallery-grid, .gallery-masonry { + margin: -px; + } + .*?\*\/)|^\s*|\s*$#s', + // Remove unused white-space(s) + '#("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\'|\/\*(?>.*?\*\/) )|\s*+;\s*+(})\s*+|\s*+([*$~^|]?+=|[{};,>~+]|\s*+-(?![0-9\.])|!important\b)\s*+|([[(:])\s++|\s++([])])|\s++(:)\s*+(?!(?>[^{}"\']++|"(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\' )*+{)|^\s++|\s++\z|(\s)\s+#si', + ), + array( + '$1', + '$1$2$3$4$5$6$7', + ), + $css + ); + + $custom = get_option( 'coletivo_custom_css' ); + if ( $custom ){ + $css.= "\n/* --- Begin custom CSS --- */\n". $custom."\n/* --- End custom CSS --- */\n"; + } + + wp_add_inline_style( 'coletivo-style', $css ); } } if ( ! function_exists( 'coletivo_get_section_featuredpage_data' ) ) { - /** - * Get Featured Page data - * - * @return array - */ - function coletivo_get_section_featuredpage_data() - { - $id = get_theme_mod('coletivo_featuredpage_content'); - if ( ! $id ) { - return false; - } - $page_ids = array( $id ); - return $page_ids; - } + /** + * Get Featured Page data + * + * @return array + */ + function coletivo_get_section_featuredpage_data() + { + $id = get_theme_mod( 'coletivo_featuredpage_content' ); + if ( ! $id ) { + return false; + } + $page_ids = array( $id ); + return $page_ids; + } } if ( ! function_exists( 'coletivo_get_section_services_data' ) ) { - /** - * Get services data - * @return array - */ - function coletivo_get_section_services_data() - { - $services = get_theme_mod('coletivo_services'); - if (is_string($services)) { - $services = json_decode($services, true); - } - $page_ids = array(); - if (!empty($services) && is_array($services)) { - foreach ($services as $k => $v) { - if (isset ($v['content_page'])) { - $v['content_page'] = absint($v['content_page']); - if ($v['content_page'] > 0) { - $page_ids[] = wp_parse_args($v, array( - 'icon_type' => 'icon', - 'image' => '', - 'icon' => 'gg', - 'enable_link' => 0 - )); - } - } - } - } - // if still empty data then get some page for demo - return $page_ids; - } + /** + * Get services data + * + * @return array + */ + function coletivo_get_section_services_data() + { + $services = get_theme_mod( 'coletivo_services' ); + if (is_string( $services) ) { + $services = json_decode( $services, true); + } + $page_ids = array(); + if ( !empty( $services) && is_array( $services) ) { + foreach ( $services as $k => $v) { + if (isset ( $v['content_page']) ) { + $v['content_page'] = absint( $v['content_page']); + if ( $v['content_page'] > 0) { + $page_ids[] = wp_parse_args( $v, array( + 'icon_type' => 'icon', + 'image' => '', + 'icon' => 'gg', + 'enable_link' => 0 + ) ); + } + } + } + } + // if still empty data then get some page for demo + return $page_ids; + } } if ( ! function_exists( 'coletivo_get_section_team_data' ) ) { - /** - * Get team members - * - * @return array - */ - function coletivo_get_section_team_data() - { - $members = get_theme_mod('coletivo_team_members'); - if (is_string($members)) { - $members = json_decode($members, true); - } - if (!is_array($members)) { - $members = array(); - } - return $members; - } + /** + * Get team members + * + * @return array + */ + function coletivo_get_section_team_data() + { + $members = get_theme_mod( 'coletivo_team_members' ); + if (is_string( $members) ) { + $members = json_decode( $members, true); + } + if ( !is_array( $members) ) { + $members = array(); + } + return $members; + } } if ( ! function_exists( 'coletivo_get_section_features_data' ) ) { - /** - * Get features data - * - * @since 1.1.4 - * @return array - */ - function coletivo_get_section_features_data() - { - $array = get_theme_mod('coletivo_features_boxes'); - if (is_string($array)) { - $array = json_decode($array, true); - } - if (!empty($array) && is_array($array)) { - foreach ($array as $k => $v) { - $array[$k] = wp_parse_args($v, array( - 'icon' => 'gg', - 'title' => '', - 'desc' => '', - 'link' => '', - )); - - //Get/Set social icons - $array[$k]['icon'] = trim($array[$k]['icon']); - if ($array[$k]['icon'] != '' && strpos($array[$k]['icon'], 'fa') !== 0) { - $array[$k]['icon'] = 'fa-' . $array[$k]['icon']; - } - } - } - return $array; - } + /** + * Get features data + * + * @since 1.1.4 + * @return array + */ + function coletivo_get_section_features_data() + { + $array = get_theme_mod( 'coletivo_features_boxes' ); + if (is_string( $array) ) { + $array = json_decode( $array, true); + } + if ( !empty( $array) && is_array( $array) ) { + foreach ( $array as $k => $v) { + $array[$k] = wp_parse_args( $v, array( + 'icon' => 'gg', + 'title' => '', + 'desc' => '', + 'link' => '', + ) ); + + // Get/Set social icons + $array[$k]['icon'] = trim( $array[$k]['icon']); + if ( $array[$k]['icon'] != '' && strpos( $array[$k]['icon'], 'fa' ) !== 0) { + $array[$k]['icon'] = 'fa-' . $array[$k]['icon']; + } + } + } + return $array; + } } if ( ! function_exists( 'coletivo_get_social_profiles' ) ) { - /** - * Get social profiles - * - * @since 1.1.4 - * @return bool|array - */ - function coletivo_get_social_profiles() - { - $array = get_theme_mod('coletivo_social_profiles'); - if (is_string($array)) { - $array = json_decode($array, true); - } - $html = ''; - if (!empty($array) && is_array($array)) { - foreach ($array as $k => $v) { - $array[$k] = wp_parse_args($v, array( - 'network' => '', - 'icon' => '', - 'link' => '', - )); - - //Get/Set social icons - // If icon isset - $icons = array(); - $array[$k]['icon'] = trim($array[$k]['icon']); - if ($array[$k]['icon'] != '' && strpos($array[$k]['icon'], 'fa') !== 0) { - $icons[$array[$k]['icon']] = 'fa-' . $array[$k]['icon']; - } else { - $icons[$array[$k]['icon']] = $array[$k]['icon']; - } - $network = ($array[$k]['network']) ? sanitize_title($array[$k]['network']) : false; - if ( $network && ! $array[$k]['icon'] ) { - $icons['fa-' . $network] = 'fa-' . $network; - } - - $array[$k]['icon'] = join(' ', $icons); - - } - } - - foreach ( (array) $array as $s) { - if ($s['icon'] != '') { - $html .= ''; - } - } - - return $html; - } + /** + * Get social profiles + * + * @since 1.1.4 + * @return bool|array + */ + function coletivo_get_social_profiles() + { + $array = get_theme_mod( 'coletivo_social_profiles' ); + if (is_string( $array) ) { + $array = json_decode( $array, true); + } + $html = ''; + if ( !empty( $array) && is_array( $array) ) { + foreach ( $array as $k => $v) { + $array[$k] = wp_parse_args( $v, array( + 'network' => '', + 'icon' => '', + 'link' => '', + ) ); + + // Get/Set social icons + // If icon isset + $icons = array(); + $array[$k]['icon'] = trim( $array[$k]['icon']); + if ( $array[$k]['icon'] != '' && strpos( $array[$k]['icon'], 'fa' ) !== 0) { + $icons[$array[$k]['icon']] = 'fa-' . $array[$k]['icon']; + } else { + $icons[$array[$k]['icon']] = $array[$k]['icon']; + } + $network = ( $array[$k]['network']) ? sanitize_title( $array[$k]['network']) : false; + if ( $network && ! $array[$k]['icon'] ) { + $icons['fa-' . $network] = 'fa-' . $network; + } + + $array[$k]['icon'] = join( ' ', $icons); + + } + } + + foreach ( (array) $array as $s) { + if ( $s['icon'] != '' ) { + $html .= ''; + } + } + + return $html; + } } if ( ! function_exists( 'coletivo_get_section_gallery_data' ) ) { - /** - * Get Gallery data - * - * @since 1.2.6 - * - * @return array - */ - function coletivo_get_section_gallery_data() - { - - $source = 'page'; // get_theme_mod( 'coletivo_gallery_source' ); - if( has_filter( 'coletivo_get_section_gallery_data' ) ) { - $data = apply_filters( 'coletivo_get_section_gallery_data', false ); - return $data; - } - - $data = array(); - - switch ( $source ) { - default: - $page_id = get_theme_mod( 'coletivo_gallery_source_page' ); - $images = ''; - if ( $page_id ) { - $gallery = get_post_gallery( $page_id , false ); - if ( $gallery ) { - $images = $gallery['ids']; - } - } - - $image_thumb_size = apply_filters( 'coletivo_gallery_page_img_size', 'coletivo-medium' ); - - if ( ! empty( $images ) ) { - $images = explode( ',', $images ); - foreach ( $images as $post_id ) { - $post = get_post( $post_id ); - if ( $post ) { - $img_thumb = wp_get_attachment_image_src($post_id, $image_thumb_size ); - if ($img_thumb) { - $img_thumb = $img_thumb[0]; - } - - $img_full = wp_get_attachment_image_src( $post_id, 'full' ); - if ($img_full) { - $img_full = $img_full[0]; - } - - if ( $img_thumb && $img_full ) { - $data[ $post_id ] = array( - 'id' => $post_id, - 'thumbnail' => $img_thumb, - 'full' => $img_full, - 'title' => $post->post_title, - 'content' => $post->post_content, - ); - } - } - } - } - break; - } - - return $data; - - } + /** + * Get Gallery data + * + * @since 1.2.6 + * + * @return array + */ + function coletivo_get_section_gallery_data() + { + + $source = 'page'; // get_theme_mod( 'coletivo_gallery_source' ); + if( has_filter( 'coletivo_get_section_gallery_data' ) ) { + $data = apply_filters( 'coletivo_get_section_gallery_data', false ); + return $data; + } + + $data = array(); + + switch ( $source ) { + default: + $page_id = get_theme_mod( 'coletivo_gallery_source_page' ); + $images = ''; + if ( $page_id ) { + $gallery = get_post_gallery( $page_id , false ); + if ( $gallery ) { + $images = $gallery['ids']; + } + } + + $image_thumb_size = apply_filters( 'coletivo_gallery_page_img_size', 'coletivo-medium' ); + + if ( ! empty( $images ) ) { + $images = explode( ',', $images ); + foreach ( $images as $post_id ) { + $post = get_post( $post_id ); + if ( $post ) { + $img_thumb = wp_get_attachment_image_src( $post_id, $image_thumb_size ); + if ( $img_thumb) { + $img_thumb = $img_thumb[0]; + } + + $img_full = wp_get_attachment_image_src( $post_id, 'full' ); + if ( $img_full) { + $img_full = $img_full[0]; + } + + if ( $img_thumb && $img_full ) { + $data[ $post_id ] = array( + 'id' => $post_id, + 'thumbnail' => $img_thumb, + 'full' => $img_full, + 'title' => $post->post_title, + 'content' => $post->post_content, + ); + } + } + } + } + break; + } + + return $data; + + } } /** @@ -802,42 +815,42 @@ function coletivo_get_section_gallery_data() * @return string */ function coletivo_gallery_html( $data, $inner = true, $size = 'thumbnail' ) { - $max_item = get_theme_mod( 'coletivo_g_number', 10 ); - $html = ''; - if ( ! is_array( $data ) ) { - return $html; - } - $n = count( $data ); - if ( $max_item > $n ) { - $max_item = $n; - } - $i = 0; - while( $i < $max_item ){ - $photo = current( $data ); - $i ++ ; - if ( $size == 'full' ) { - $thumb = $photo['full']; - } else { - $thumb = $photo['thumbnail']; - } - - $html .= ''; - if ( $inner ) { - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } else { - $html .= ''; - } - - $html .= ''; - next( $data ); - } - reset( $data ); - - return $html; + $max_item = get_theme_mod( 'coletivo_g_number', 10 ); + $html = ''; + if ( ! is_array( $data ) ) { + return $html; + } + $n = count( $data ); + if ( $max_item > $n ) { + $max_item = $n; + } + $i = 0; + while( $i < $max_item ){ + $photo = current( $data ); + $i ++ ; + if ( $size == 'full' ) { + $thumb = $photo['full']; + } else { + $thumb = $photo['thumbnail']; + } + + $html .= ''; + if ( $inner ) { + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + } else { + $html .= ''; + } + + $html .= ''; + next( $data ); + } + reset( $data ); + + return $html; } @@ -850,92 +863,93 @@ function coletivo_gallery_html( $data, $inner = true, $size = 'thumbnail' ) { */ function coletivo_gallery_generate( $echo = true ){ - $div = ''; - - $data = coletivo_get_section_gallery_data(); - $display_type = get_theme_mod( 'coletivo_gallery_display', 'grid' ); - $lightbox = get_theme_mod( 'coletivo_g_lightbox', 1 ); - $class = ''; - if ( $lightbox ) { - $class = ' enable-lightbox '; - } - $col = absint( get_theme_mod( 'coletivo_g_col', 4 ) ); - if ( $col <= 0 ) { - $col = 4; - } - switch( $display_type ) { - case 'masonry': - $html = coletivo_gallery_html( $data ); - if ( $html ) { - $div .= ''; - } - break; - case 'carousel': - $html = coletivo_gallery_html( $data ); - if ( $html ) { - $div .= ''; - } - break; - case 'slider': - $html = coletivo_gallery_html( $data , true , 'full' ); - if ( $html ) { - $div .= ''; - } - break; - case 'justified': - $html = coletivo_gallery_html( $data, false ); - if ( $html ) { - $gallery_spacing = absint( get_theme_mod( 'coletivo_g_spacing', 20 ) ); - $row_height = absint( get_theme_mod( 'coletivo_g_row_height', 120 ) ); - $div .= ''; - } - break; - default: // grid - $html = coletivo_gallery_html( $data ); - if ( $html ) { - $div .= ''; - } - break; - } - - if ( $echo ) { - echo $div; - } else { - return $div; - } + $div = ''; + + $data = coletivo_get_section_gallery_data(); + $display_type = get_theme_mod( 'coletivo_gallery_display', 'grid' ); + $lightbox = get_theme_mod( 'coletivo_g_lightbox', 1 ); + $class = ''; + if ( $lightbox ) { + $class = ' enable-lightbox '; + } + $col = absint( get_theme_mod( 'coletivo_g_col', 4 ) ); + if ( $col <= 0 ) { + $col = 4; + } + switch( $display_type ) { + case 'masonry': + $html = coletivo_gallery_html( $data ); + if ( $html ) { + $div .= ''; + } + break; + case 'carousel': + $html = coletivo_gallery_html( $data ); + if ( $html ) { + $div .= ''; + } + break; + case 'slider': + $html = coletivo_gallery_html( $data , true , 'full' ); + if ( $html ) { + $div .= ''; + } + break; + case 'justified': + $html = coletivo_gallery_html( $data, false ); + if ( $html ) { + $gallery_spacing = absint( get_theme_mod( 'coletivo_g_spacing', 20 ) ); + $row_height = absint( get_theme_mod( 'coletivo_g_row_height', 120 ) ); + $div .= ''; + } + break; + default: // grid + $html = coletivo_gallery_html( $data ); + if ( $html ) { + $div .= ''; + } + break; + } + + if ( $echo ) { + echo $div; + } else { + return $div; + } } if ( ! function_exists( 'coletivo_footer_site_info' ) ) { - /** - * Add Copyright and Credit text to footer - * @since 1.1.3 - */ - function coletivo_footer_site_info() - { - ?> - - - '; ?> - ' . esc_html( $coletivo_footer_text) . '
  • '; ?> - '; ?> - - - - WordPress'); ?> - + + + '; ?> + ' . esc_html( $coletivo_footer_text) . '
    '; ?> + '; ?> + + + + WordPress' ); ?> + - - + + Date: Fri, 23 Apr 2021 18:07:22 -0300 Subject: [PATCH 04/32] Coding standards (pasta section-parts) - section-services.php; - section-social.php; - section-yourslider.php. --- section-parts/section-services.php | 2 +- section-parts/section-social.php | 1 + section-parts/section-yourslider.php | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/section-parts/section-services.php b/section-parts/section-services.php index b67634b..235e0f3 100644 --- a/section-parts/section-services.php +++ b/section-parts/section-services.php @@ -65,7 +65,7 @@ class=" Date: Thu, 6 May 2021 17:53:50 -0300 Subject: [PATCH 05/32] =?UTF-8?q?Coding=20standards=20e=20componentiza?= =?UTF-8?q?=C3=A7=C3=A3o=20do=20Customizer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Refatoração WPCS no arquivo do Customizer; - Separação em diversos arquivos de trechos de seções do Customizer. --- .../customizer-blog-page-settings.php | 44 + .../customizer-footer.php | 104 + .../customizer-global-settings.php | 83 + .../customizer-header.php | 207 ++ .../customizer-hero-options.php | 71 + .../customizer-section-contact.php | 374 +++ .../customizer-section-featured-page.php | 180 + .../customizer-section-features.php | 216 ++ .../customizer-section-gallery.php | 341 ++ .../customizer-section-hero.php | 487 +++ .../customizer-section-news.php | 197 ++ .../customizer-section-portfolio.php | 188 ++ .../customizer-section-sections.php | 64 + .../customizer-section-services.php | 213 ++ .../customizer-section-slider.php | 132 + .../customizer-section-social.php | 162 + .../customizer-section-team.php | 195 ++ .../customizer-section-video-lightbox.php | 145 + .../customizer-site-identity.php | 46 + .../customizer-site-options.php | 22 + inc/customizer.php | 2954 ++--------------- 21 files changed, 3667 insertions(+), 2758 deletions(-) create mode 100644 inc/customizer-components/customizer-blog-page-settings.php create mode 100644 inc/customizer-components/customizer-footer.php create mode 100644 inc/customizer-components/customizer-global-settings.php create mode 100644 inc/customizer-components/customizer-header.php create mode 100644 inc/customizer-components/customizer-hero-options.php create mode 100644 inc/customizer-components/customizer-section-contact.php create mode 100644 inc/customizer-components/customizer-section-featured-page.php create mode 100644 inc/customizer-components/customizer-section-features.php create mode 100644 inc/customizer-components/customizer-section-gallery.php create mode 100644 inc/customizer-components/customizer-section-hero.php create mode 100644 inc/customizer-components/customizer-section-news.php create mode 100644 inc/customizer-components/customizer-section-portfolio.php create mode 100644 inc/customizer-components/customizer-section-sections.php create mode 100644 inc/customizer-components/customizer-section-services.php create mode 100644 inc/customizer-components/customizer-section-slider.php create mode 100644 inc/customizer-components/customizer-section-social.php create mode 100644 inc/customizer-components/customizer-section-team.php create mode 100644 inc/customizer-components/customizer-section-video-lightbox.php create mode 100644 inc/customizer-components/customizer-site-identity.php create mode 100644 inc/customizer-components/customizer-site-options.php diff --git a/inc/customizer-components/customizer-blog-page-settings.php b/inc/customizer-components/customizer-blog-page-settings.php new file mode 100644 index 0000000..7c0c308 --- /dev/null +++ b/inc/customizer-components/customizer-blog-page-settings.php @@ -0,0 +1,44 @@ +add_section( + 'coletivo_blog_page', + array( + 'priority' => 15, + 'title' => esc_html__( 'Blog Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'theme_options', + ) +); + +$wp_customize->add_setting( + 'coletivo_blog_page_style', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_blog_page_style', + array( + 'label' => esc_html__( 'Blog style', 'coletivo' ), + 'section' => 'coletivo_blog_page', + 'description' => '', + 'type' => 'radio', + 'default' => 'grid', + 'choices' => array( + 'grid' => __( 'Grid', 'coletivo' ), + 'list' => __( 'List', 'coletivo' ), + ), + ) +); diff --git a/inc/customizer-components/customizer-footer.php b/inc/customizer-components/customizer-footer.php new file mode 100644 index 0000000..4c0bf48 --- /dev/null +++ b/inc/customizer-components/customizer-footer.php @@ -0,0 +1,104 @@ +add_section( + 'coletivo_footer_settings', + array( + 'priority' => 10, + 'title' => esc_html__( 'Footer', 'coletivo' ), + 'description' => '', + 'panel' => 'theme_options', + ) +); + +// Footer custom Text. +$wp_customize->add_setting( + 'coletivo_footer_text', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Few Rights Reserved', 'coletivo' ), + 'transport' => 'refresh', + ) +); + +$wp_customize->add_control( + 'coletivo_footer_text', + array( + 'type' => 'text', + 'label' => esc_html__( 'Footer Text', 'coletivo' ), + 'section' => 'coletivo_footer_settings', + 'description' => '', + ) +); + +// Footer custom Link. +$wp_customize->add_setting( + 'coletivo_footer_text_link', + array( + 'sanitize_callback' => 'esc_url', + 'default' => esc_url( home_url( '/' ) ), + 'transport' => 'refresh', + ) +); + +$wp_customize->add_control( + 'coletivo_footer_text_link', + array( + 'type' => 'text', + 'label' => esc_html__( 'Footer Link', 'coletivo' ), + 'section' => 'coletivo_footer_settings', + 'description' => '', + ) +); + +// Footer Info BG Color. +$wp_customize->add_setting( + 'coletivo_footer_info_bg', + array( + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'default' => '', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'coletivo_footer_info_bg', + array( + 'label' => esc_html__( 'Footer Info Background', 'coletivo' ), + 'section' => 'coletivo_footer_settings', + 'description' => '', + ) + ) +); + +// Disable Back to top. +$wp_customize->add_setting( + 'coletivo_btt_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + 'coletivo_btt_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide footer back to top?', 'coletivo' ), + 'section' => 'coletivo_footer_settings', + 'description' => esc_html__( 'Check this box to hide footer back to top button.', 'coletivo' ), + ) +); diff --git a/inc/customizer-components/customizer-global-settings.php b/inc/customizer-components/customizer-global-settings.php new file mode 100644 index 0000000..afed599 --- /dev/null +++ b/inc/customizer-components/customizer-global-settings.php @@ -0,0 +1,83 @@ +add_section( + 'coletivo_global_settings', + array( + 'priority' => 1, + 'title' => esc_html__( 'Global', 'coletivo' ), + 'description' => '', + 'panel' => 'theme_options', + ) +); + +// Primary Color. +$wp_customize->add_setting( + 'coletivo_primary_color', + array( + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'default' => '#03c4eb', + ) +); + +$wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'coletivo_primary_color', + array( + 'label' => esc_html__( 'Primary Color', 'coletivo' ), + 'section' => 'coletivo_global_settings', + 'description' => '', + 'priority' => 1, + ) + ) +); + +// Disable Animation. +$wp_customize->add_setting( + 'coletivo_animation_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_animation_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Disable animation effect?', 'coletivo' ), + 'section' => 'coletivo_global_settings', + 'description' => esc_html__( 'Check this box to disable all element animation when scroll.', 'coletivo' ), + ) +); + +// Header Transparent. +$wp_customize->add_setting( + 'coletivo_header_transparent', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_control( + 'coletivo_header_transparent', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Header Transparent', 'coletivo' ), + 'section' => 'coletivo_global_settings', + 'description' => esc_html__( 'Apply for front page template only.', 'coletivo' ), + ) +); diff --git a/inc/customizer-components/customizer-header.php b/inc/customizer-components/customizer-header.php new file mode 100644 index 0000000..51492bd --- /dev/null +++ b/inc/customizer-components/customizer-header.php @@ -0,0 +1,207 @@ +add_section( + 'coletivo_header_settings', + array( + 'priority' => 5, + 'title' => esc_html__( 'Header', 'coletivo' ), + 'description' => '', + 'panel' => 'theme_options', + ) +); + +// Hidden field to reorder home sections. +$wp_customize->add_setting( + 'coletivo_sections_order', + array( + 'default' => apply_filters( 'coletivo_sections_order_default_value', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ), + ) +); + +$wp_customize->add_control( + 'coletivo_sections_order', + array( + 'type' => 'hidden', + 'section' => 'coletivo_header_settings', + ) +); + +// Header BG Color. +$wp_customize->add_setting( + 'coletivo_header_bg_color', + array( + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'default' => '', + ) +); + +$wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'coletivo_header_bg_color', + array( + 'label' => esc_html__( 'Background Color', 'coletivo' ), + 'section' => 'coletivo_header_settings', + 'description' => '', + ) + ) +); + +// Site Title Color. +$wp_customize->add_setting( + 'coletivo_logo_text_color', + array( + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'default' => '', + ) +); + +$wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'coletivo_logo_text_color', + array( + 'label' => esc_html__( 'Site Title Color', 'coletivo' ), + 'section' => 'coletivo_header_settings', + 'description' => esc_html__( 'Only set if you don\'t use an image logo.', 'coletivo' ), + ) + ) +); + +// Header Menu Color. +$wp_customize->add_setting( + 'coletivo_menu_color', + array( + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'default' => '', + ) +); + +$wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'coletivo_menu_color', + array( + 'label' => esc_html__( 'Menu Link Color', 'coletivo' ), + 'section' => 'coletivo_header_settings', + 'description' => '', + ) + ) +); + +// Header Menu Hover Color. +$wp_customize->add_setting( + 'coletivo_menu_hover_color', + array( + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'default' => '', + ) +); + +$wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'coletivo_menu_hover_color', + array( + 'label' => esc_html__( 'Menu Link Hover/Active Color', 'coletivo' ), + 'section' => 'coletivo_header_settings', + 'description' => '', + ) + ) +); + +// Header Menu Hover BG Color. +$wp_customize->add_setting( + 'coletivo_menu_hover_bg_color', + array( + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'default' => '', + ) +); + +$wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'coletivo_menu_hover_bg_color', + array( + 'label' => esc_html__( 'Menu Link Hover/Active BG Color', 'coletivo' ), + 'section' => 'coletivo_header_settings', + 'description' => '', + ) + ) +); + +// Reponsive Mobile button color. +$wp_customize->add_setting( + 'coletivo_menu_toggle_button_color', + array( + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'default' => '', + ) +); + +$wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'coletivo_menu_toggle_button_color', + array( + 'label' => esc_html__( 'Responsive Menu Button Color', 'coletivo' ), + 'section' => 'coletivo_header_settings', + 'description' => '', + ) + ) +); + +// Vertical align menu. +$wp_customize->add_setting( + 'coletivo_vertical_align_menu', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_vertical_align_menu', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Center vertical align for menu', 'coletivo' ), + 'section' => 'coletivo_header_settings', + 'description' => esc_html__( 'If you use logo and your logo is too tall, check this box to auto vertical align menu.', 'coletivo' ), + ) +); + +// Disable Sticky Header. +$wp_customize->add_setting( + 'coletivo_sticky_header_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_sticky_header_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Disable Sticky Header?', 'coletivo' ), + 'section' => 'coletivo_header_settings', + 'description' => esc_html__( 'Check this box to disable sticky header when scroll.', 'coletivo' ), + ) +); diff --git a/inc/customizer-components/customizer-hero-options.php b/inc/customizer-components/customizer-hero-options.php new file mode 100644 index 0000000..26b80bb --- /dev/null +++ b/inc/customizer-components/customizer-hero-options.php @@ -0,0 +1,71 @@ +add_section( + 'coletivo_hero_options', + array( + 'title' => __( 'Hero Options', 'coletivo' ), + 'panel' => 'theme_options', + 'priority' => 20, + ) +); + +$wp_customize->add_setting( + 'coletivo_hero_option_animation', + array( + 'default' => 'flipInX', + 'sanitize_callback' => 'sanitize_text_field', + ) +); + +/** + * Animate CSS + * + * @see https://github.com/daneden/animate.css + */ +$animations_css = 'bounce flash pulse rubberBand shake headShake swing tada wobble jello bounceIn bounceInDown bounceInLeft bounceInRight bounceInUp bounceOut bounceOutDown bounceOutLeft bounceOutRight bounceOutUp fadeIn fadeInDown fadeInDownBig fadeInLeft fadeInLeftBig fadeInRight fadeInRightBig fadeInUp fadeInUpBig fadeOut fadeOutDown fadeOutDownBig fadeOutLeft fadeOutLeftBig fadeOutRight fadeOutRightBig fadeOutUp fadeOutUpBig flipInX flipInY flipOutX flipOutY lightSpeedIn lightSpeedOut rotateIn rotateInDownLeft rotateInDownRight rotateInUpLeft rotateInUpRight rotateOut rotateOutDownLeft rotateOutDownRight rotateOutUpLeft rotateOutUpRight hinge rollIn rollOut zoomIn zoomInDown zoomInLeft zoomInRight zoomInUp zoomOut zoomOutDown zoomOutLeft zoomOutRight zoomOutUp slideInDown slideInLeft slideInRight slideInUp slideOutDown slideOutLeft slideOutRight slideOutUp'; +$animations_css = explode( ' ', $animations_css ); +$animations = array(); + +foreach ( $animations_css as $v ) { + $v = trim( $v ); + if ( $v ) { + $animations[ $v ] = $v; + } +} + +$wp_customize->add_control( + 'coletivo_hero_option_animation', + array( + 'label' => __( 'Text animation', 'coletivo' ), + 'section' => 'coletivo_hero_options', + 'type' => 'select', + 'choices' => $animations, + ) +); + +$wp_customize->add_setting( + 'coletivo_hero_option_speed', + array( + 'default' => '5000', + 'sanitize_callback' => 'sanitize_text_field', + ) +); + +$wp_customize->add_control( + 'coletivo_hero_option_speed', + array( + 'label' => __( 'Speed', 'coletivo' ), + 'description' => esc_html__( 'The delay between the changing of each phrase in milliseconds.', 'coletivo' ), + 'section' => 'coletivo_hero_options', + ) +); diff --git a/inc/customizer-components/customizer-section-contact.php b/inc/customizer-components/customizer-section-contact.php new file mode 100644 index 0000000..7b478c6 --- /dev/null +++ b/inc/customizer-components/customizer-section-contact.php @@ -0,0 +1,374 @@ +add_panel( + 'coletivo_contact', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_contact' ), + 'title' => esc_html__( 'Section: Contact', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_section( + 'coletivo_contact_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_contact', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_contact_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_contact_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Show Form. +$wp_customize->add_setting( + 'coletivo_contact_cf7_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_cf7_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide contact form completely.', 'coletivo' ), + 'section' => 'coletivo_contact_settings', + 'description' => esc_html__( 'Check this box to hide contact form.', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_contact_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'contact', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_contact_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_contact_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_contact_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Get in touch', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_contact_title', + array( + 'label' => esc_html__( 'Section Title', 'coletivo' ), + 'section' => 'coletivo_contact_settings', + 'description' => '', + ) +); + +// Sub Title. +$wp_customize->add_setting( + 'coletivo_contact_subtitle', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Section subtitle', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_contact_subtitle', + array( + 'label' => esc_html__( 'Section Subtitle', 'coletivo' ), + 'section' => 'coletivo_contact_settings', + 'description' => '', + ) +); + +// Description. +$wp_customize->add_setting( + 'coletivo_contact_desc', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_contact_desc', + array( + 'label' => esc_html__( 'Section Description', 'coletivo' ), + 'section' => 'coletivo_contact_settings', + 'description' => '', + ) + ) +); + +$wp_customize->add_section( + 'coletivo_contact_content', + array( + 'priority' => 6, + 'title' => esc_html__( 'Section Content', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_contact', + ) +); + +// Contact form guide. +$wp_customize->add_setting( + 'coletivo_contact_cf7_guide', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + ) +); + +$wp_customize->add_control( + new coletivo_Misc_Control( + $wp_customize, + 'coletivo_contact_cf7_guide', + array( + 'section' => 'coletivo_contact_content', + 'type' => 'custom_message', + 'description' => __( 'In order to display a contact form install a plugin and then copy the shortcode and paste it here, the shortcode will be like this [contact-form][contact-field...][/contact-form]', 'coletivo' ), + ) + ) +); + +// Contact Form Shortcode. +$wp_customize->add_setting( + 'coletivo_contact_cf7', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_cf7', + array( + 'label' => esc_html__( 'Contact Form Shortcode', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => '', + ) +); + +// hr. +$wp_customize->add_setting( + 'coletivo_contact_text_hr', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + ) +); + +$wp_customize->add_control( + new coletivo_Misc_Control( + $wp_customize, + 'coletivo_contact_text_hr', + array( + 'section' => 'coletivo_contact_content', + 'type' => 'hr', + ) + ) +); + +// Contact Text. +$wp_customize->add_setting( + 'coletivo_contact_address_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_address_title', + array( + 'label' => esc_html__( 'Contact Box Title', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => '', + ) +); + +$wp_customize->add_setting( + 'coletivo_contact_text', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_contact_text', + array( + 'label' => esc_html__( 'Contact Text', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => '', + ) + ) +); + +// Address Box. +// Contact Address. +$wp_customize->add_setting( + 'coletivo_contact_address', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_address', + array( + 'label' => esc_html__( 'Address', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => '', + ) +); + +// Contact Phone. +$wp_customize->add_setting( + 'coletivo_contact_phone', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_phone', + array( + 'label' => esc_html__( 'Phone', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => '', + ) +); + +// Contact WhatsApp. +$wp_customize->add_setting( + 'coletivo_contact_whats', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_whats', + array( + 'label' => esc_html__( 'What´s App', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => '', + ) +); + +// Contact Email. +$wp_customize->add_setting( + 'coletivo_contact_email', + array( + 'sanitize_callback' => 'sanitize_email', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_email', + array( + 'label' => esc_html__( 'Email', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => '', + ) +); + +// Contact Social Networks. +$wp_customize->add_setting( + 'coletivo_contact_fb', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_fb', + array( + 'label' => esc_html__( 'Facebook', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => esc_html__( 'Enter the name of the page url after the "/" (example of url https://www.facebook.com/facebook, just put facebook)', 'coletivo' ), + ) +); + +$wp_customize->add_setting( + 'coletivo_contact_instagram', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_instagram', + array( + 'label' => esc_html__( 'Instagram', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => esc_html__( 'Enter your Instagram username', 'coletivo' ), + ) +); + +$wp_customize->add_setting( + 'coletivo_contact_twitter', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_contact_twitter', + array( + 'label' => esc_html__( 'Twitter', 'coletivo' ), + 'section' => 'coletivo_contact_content', + 'description' => esc_html__( 'Enter your Twitter username', 'coletivo' ), + ) +); diff --git a/inc/customizer-components/customizer-section-featured-page.php b/inc/customizer-components/customizer-section-featured-page.php new file mode 100644 index 0000000..6523e30 --- /dev/null +++ b/inc/customizer-components/customizer-section-featured-page.php @@ -0,0 +1,180 @@ +add_panel( + 'coletivo_featuredpage', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_featuredpage' ), + 'title' => esc_html__( 'Section: Page Featured', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_section( + 'coletivo_featuredpage_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_featuredpage', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_featuredpage_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_featuredpage_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_featuredpage_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_featuredpage_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_featuredpage_title', + array( + 'label' => esc_html__( 'Title section in customizer', 'coletivo' ), + 'section' => 'coletivo_featuredpage_settings', + 'description' => esc_html__( 'This title is only showed in customizer', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_featuredpage_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'featuredpage', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_featuredpage_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_featuredpage_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +$wp_customize->add_section( + 'coletivo_featuredpage_content', + array( + 'priority' => 6, + 'title' => esc_html__( 'Section Content', 'coletivo' ), + 'panel' => 'coletivo_featuredpage', + ) +); + +// Select Page. +$wp_customize->add_setting( + 'coletivo_featuredpage_content', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field', + ) +); + +$wp_customize->add_control( + 'coletivo_featuredpage_content', + array( + 'label' => esc_html__( 'Featured Page', 'coletivo' ), + 'section' => 'coletivo_featuredpage_content', + 'description' => esc_html__( 'You need to select a Featured Image for a background in full size.', 'coletivo' ), + 'type' => 'select', + 'choices' => $option_pages, + 'fields' => array( + 'options' => $option_pages, + ), + ) +); + +// Featured page content source. +$wp_customize->add_setting( + 'coletivo_featuredpage_content_source', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'content', + ) +); + +$wp_customize->add_control( + 'coletivo_featuredpage_content_source', + array( + 'label' => esc_html__( 'Content source', 'coletivo' ), + 'section' => 'coletivo_featuredpage_content', + 'type' => 'select', + 'choices' => array( + 'content' => esc_html__( 'Full Page Content', 'coletivo' ), + 'excerpt' => esc_html__( 'Page Excerpt', 'coletivo' ), + ), + ) +); + +// More Button. +$wp_customize->add_setting( + 'coletivo_featuredpage_more_text', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Discover', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_featuredpage_more_text', + array( + 'label' => esc_html__( 'Featured Page Button Text', 'coletivo' ), + 'section' => 'coletivo_featuredpage_content', + 'description' => '', + ) +); + +// Overlay color. +$wp_customize->add_setting( + 'coletivo_featuredpage_overlay_color', + array( + 'sanitize_callback' => 'coletivo_sanitize_color_alpha', + 'default' => 'rgba(0,0,0,.3)', + 'transport' => 'refresh', // refresh or postMessage. + ) +); + +$wp_customize->add_control( + new coletivo_Alpha_Color_Control( + $wp_customize, + 'coletivo_featuredpage_overlay_color', + array( + 'label' => esc_html__( 'Background Overlay Color', 'coletivo' ), + 'section' => 'coletivo_featuredpage_content', + 'priority' => 30, + ) + ) +); diff --git a/inc/customizer-components/customizer-section-features.php b/inc/customizer-components/customizer-section-features.php new file mode 100644 index 0000000..024bd48 --- /dev/null +++ b/inc/customizer-components/customizer-section-features.php @@ -0,0 +1,216 @@ +add_panel( + 'coletivo_features', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_features' ), + 'title' => esc_html__( 'Section: Features', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_section( + 'coletivo_features_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_features', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_features_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_features_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_features_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_features_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'features', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_features_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_features_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_features_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Features', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_features_title', + array( + 'label' => esc_html__( 'Section Title', 'coletivo' ), + 'section' => 'coletivo_features_settings', + 'description' => '', + ) +); + +// Sub Title. +$wp_customize->add_setting( + 'coletivo_features_subtitle', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Section subtitle', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_features_subtitle', + array( + 'label' => esc_html__( 'Section Subtitle', 'coletivo' ), + 'section' => 'coletivo_features_settings', + 'description' => '', + ) +); + +// Description. +$wp_customize->add_setting( + 'coletivo_features_desc', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_features_desc', + array( + 'label' => esc_html__( 'Section Description', 'coletivo' ), + 'section' => 'coletivo_features_settings', + 'description' => '', + ) + ) +); + +// Features layout. +$wp_customize->add_setting( + 'coletivo_features_layout', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => '3', + ) +); + +$wp_customize->add_control( + 'coletivo_features_layout', + array( + 'label' => esc_html__( 'Features Layout Setting', 'coletivo' ), + 'section' => 'coletivo_features_settings', + 'description' => '', + 'type' => 'select', + 'choices' => array( + '3' => esc_html__( '4 Columns', 'coletivo' ), + '4' => esc_html__( '3 Columns', 'coletivo' ), + '6' => esc_html__( '2 Columns', 'coletivo' ), + ), + ) +); + +$wp_customize->add_section( + 'coletivo_features_content', + array( + 'priority' => 6, + 'title' => esc_html__( 'Section Content', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_features', + ) +); + +// Order & Styling. +$wp_customize->add_setting( + 'coletivo_features_boxes', + array( + 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', + 'transport' => 'refresh', // refresh or postMessage. + ) +); + +$wp_customize->add_control( + new coletivo_Customize_Repeatable_Control( + $wp_customize, + 'coletivo_features_boxes', + array( + 'label' => esc_html__( 'Features content', 'coletivo' ), + 'description' => '', + 'section' => 'coletivo_features_content', + 'live_title_id' => 'title', // apply for unput text and textarea only. + 'title_format' => esc_html__( '[live_title]', 'coletivo' ), + 'max_item' => 12, // Maximum item can add. + 'limited_msg' => esc_html__( 'Only 12 features allowed', 'coletivo' ), + 'fields' => array( + 'title' => array( + 'title' => esc_html__( 'Title', 'coletivo' ), + 'type' => 'text', + ), + 'icon_type' => array( + 'title' => esc_html__( 'Custom icon', 'coletivo' ), + 'type' => 'select', + 'options' => array( + 'icon' => esc_html__( 'Icon', 'coletivo' ), + 'image' => esc_html__( 'image', 'coletivo' ), + ), + ), + 'icon' => array( + 'title' => esc_html__( 'Icon', 'coletivo' ), + 'type' => 'icon', + 'required' => array( 'icon_type', '=', 'icon' ), + ), + 'image' => array( + 'title' => esc_html__( 'Image', 'coletivo' ), + 'type' => 'media', + 'required' => array( 'icon_type', '=', 'image' ), + ), + 'desc' => array( + 'title' => esc_html__( 'Description', 'coletivo' ), + 'type' => 'editor', + ), + 'link' => array( + 'title' => esc_html__( 'Custom Link', 'coletivo' ), + 'type' => 'text', + ), + ), + ) + ) +); diff --git a/inc/customizer-components/customizer-section-gallery.php b/inc/customizer-components/customizer-section-gallery.php new file mode 100644 index 0000000..c3f77b1 --- /dev/null +++ b/inc/customizer-components/customizer-section-gallery.php @@ -0,0 +1,341 @@ +add_panel( + 'coletivo_gallery', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_gallery' ), + 'title' => esc_html__( 'Section: Gallery', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_section( + 'coletivo_gallery_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_gallery', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_gallery_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => 1, + ) +); + +$wp_customize->add_control( + 'coletivo_gallery_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_gallery_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_gallery_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'gallery', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_gallery_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_gallery_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_gallery_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Gallery', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_gallery_title', + array( + 'label' => esc_html__( 'Section Title', 'coletivo' ), + 'section' => 'coletivo_gallery_settings', + 'description' => '', + ) +); + +// Sub Title. +$wp_customize->add_setting( + 'coletivo_gallery_subtitle', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Section subtitle', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_gallery_subtitle', + array( + 'label' => esc_html__( 'Section Subtitle', 'coletivo' ), + 'section' => 'coletivo_gallery_settings', + 'description' => '', + ) +); + +// Description. +$wp_customize->add_setting( + 'coletivo_gallery_desc', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_gallery_desc', + array( + 'label' => esc_html__( 'Section Description', 'coletivo' ), + 'section' => 'coletivo_gallery_settings', + 'description' => '', + ) + ) +); + +$wp_customize->add_section( + 'coletivo_gallery_content', + array( + 'priority' => 6, + 'title' => esc_html__( 'Section Content', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_gallery', + ) +); + +// Source page settings. +$wp_customize->add_setting( + 'coletivo_gallery_source_page', + array( + 'sanitize_callback' => 'coletivo_sanitize_number', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_gallery_source_page', + array( + 'label' => esc_html__( 'Select Gallery Page', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'type' => 'select', + 'priority' => 10, + 'choices' => $option_pages, + 'description' => esc_html__( 'Select a page which have content contain [gallery] shortcode.', 'coletivo' ), + ) +); + +// Gallery Layout. +$wp_customize->add_setting( + 'coletivo_gallery_layout', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'default', + ) +); + +$wp_customize->add_control( + 'coletivo_gallery_layout', + array( + 'label' => esc_html__( 'Layout', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'type' => 'select', + 'priority' => 40, + 'choices' => array( + 'default' => esc_html__( 'Default, inside container', 'coletivo' ), + 'full-width' => esc_html__( 'Full Width', 'coletivo' ), + ), + ) +); + +// Gallery Display. +$wp_customize->add_setting( + 'coletivo_gallery_display', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'default', + ) +); + +$wp_customize->add_control( + 'coletivo_gallery_display', + array( + 'label' => esc_html__( 'Display', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'type' => 'select', + 'priority' => 50, + 'choices' => array( + 'grid' => esc_html__( 'Grid', 'coletivo' ), + 'carousel' => esc_html__( 'Carousel', 'coletivo' ), + 'slider' => esc_html__( 'Slider', 'coletivo' ), + 'justified' => esc_html__( 'Justified', 'coletivo' ), + ), + ) +); + +// Gallery grid spacing. +$wp_customize->add_setting( + 'coletivo_g_spacing', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 20, + ) +); + +$wp_customize->add_control( + 'coletivo_g_spacing', + array( + 'label' => esc_html__( 'Item Spacing', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'priority' => 55, + ) +); + +// Gallery grid spacing. +$wp_customize->add_setting( + 'coletivo_g_row_height', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 120, + ) +); + +$wp_customize->add_control( + 'coletivo_g_row_height', + array( + 'label' => esc_html__( 'Row Height', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'priority' => 57, + ) +); + +// Gallery grid gird col. +$wp_customize->add_setting( + 'coletivo_g_col', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => '4', + ) +); + +$wp_customize->add_control( + 'coletivo_g_col', + array( + 'label' => esc_html__( 'Layout columns', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'priority' => 60, + 'type' => 'select', + 'choices' => array( + '1' => 1, + '2' => 2, + '3' => 3, + '4' => 4, + '5' => 5, + '6' => 6, + ), + ) +); + +// Gallery max number. +$wp_customize->add_setting( + 'coletivo_g_number', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 10, + ) +); + +$wp_customize->add_control( + 'coletivo_g_number', + array( + 'label' => esc_html__( 'Number items', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'priority' => 65, + ) +); + +// Gallery grid spacing. +$wp_customize->add_setting( + 'coletivo_g_lightbox', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => 1, + ) +); + +$wp_customize->add_control( + 'coletivo_g_lightbox', + array( + 'label' => esc_html__( 'Enable Lightbox', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'priority' => 70, + 'type' => 'checkbox', + ) +); + +// Gallery readmore link. +$wp_customize->add_setting( + 'coletivo_g_readmore_link', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_g_readmore_link', + array( + 'label' => esc_html__( 'Read More Link', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'priority' => 90, + 'type' => 'text', + ) +); + +$wp_customize->add_setting( + 'coletivo_g_readmore_text', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'View More', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_g_readmore_text', + array( + 'label' => esc_html__( 'Read More Text', 'coletivo' ), + 'section' => 'coletivo_gallery_content', + 'priority' => 100, + 'type' => 'text', + ) +); diff --git a/inc/customizer-components/customizer-section-hero.php b/inc/customizer-components/customizer-section-hero.php new file mode 100644 index 0000000..6992fd1 --- /dev/null +++ b/inc/customizer-components/customizer-section-hero.php @@ -0,0 +1,487 @@ +add_panel( + 'coletivo_hero_panel', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_hero_panel' ), + 'title' => esc_html__( 'Section: Hero', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +// Hero settings. +$wp_customize->add_section( + 'coletivo_hero_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Hero Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_hero_panel', + ) +); + +// Show section. +$wp_customize->add_setting( + 'coletivo_hero_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_hero_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_hero_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_hero_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_hero_title', + array( + 'label' => esc_html__( 'Title section in customizer', 'coletivo' ), + 'section' => 'coletivo_hero_settings', + 'description' => esc_html__( 'This title is only showed in customizer', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_hero_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'hero', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_hero_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_hero_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +// Show hero full screen. +$wp_customize->add_setting( + 'coletivo_hero_fullscreen', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_hero_fullscreen', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Make hero section full screen', 'coletivo' ), + 'section' => 'coletivo_hero_settings', + 'description' => esc_html__( 'Check this box to make hero section full screen.', 'coletivo' ), + ) +); + +// Hero content padding top. +$wp_customize->add_setting( + 'coletivo_hero_pdtop', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( '10', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_hero_pdtop', + array( + 'label' => esc_html__( 'Padding Top:', 'coletivo' ), + 'section' => 'coletivo_hero_settings', + 'description' => esc_html__( 'The hero content padding top in percent (%).', 'coletivo' ), + 'active_callback' => 'coletivo_hero_fullscreen_callback', + ) +); + +// Hero content padding bottom. +$wp_customize->add_setting( + 'coletivo_hero_pdbotom', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( '10', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_hero_pdbotom', + array( + 'label' => esc_html__( 'Padding Bottom:', 'coletivo' ), + 'section' => 'coletivo_hero_settings', + 'description' => esc_html__( 'The hero content padding bottom in percent (%).', 'coletivo' ), + 'active_callback' => 'coletivo_hero_fullscreen_callback', + ) +); + +$wp_customize->add_section( + 'coletivo_hero_images', + array( + 'priority' => 6, + 'title' => esc_html__( 'Hero Background Media', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_hero_panel', + ) +); + +$wp_customize->add_setting( + 'coletivo_hero_images', + array( + 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', + 'transport' => 'refresh', // refresh or postMessage. + 'default' => wp_json_encode( + array( + array( + 'image' => array( + 'url' => get_template_directory_uri() . '/assets/images/coletivo1.jpg', + 'id' => '', + ), + ), + ), + ), + ) +); + +$wp_customize->add_control( + new coletivo_Customize_Repeatable_Control( + $wp_customize, + 'coletivo_hero_images', + array( + 'label' => esc_html__( 'Background Images', 'coletivo' ), + 'description' => '', + 'priority' => 40, + 'section' => 'coletivo_hero_images', + 'title_format' => esc_html__( 'Background', 'coletivo' ), + 'max_item' => 5, // Maximum item can add. + 'fields' => array( + 'image' => array( + 'title' => esc_html__( 'Background Image', 'coletivo' ), + 'type' => 'media', + 'default' => array( + 'url' => get_template_directory_uri() . '/assets/images/coletivo1.jpg', + 'id' => '', + ), + ), + ), + ) + ) +); + +// Overlay color. +$wp_customize->add_setting( + 'coletivo_hero_overlay_color', + array( + 'sanitize_callback' => 'coletivo_sanitize_color_alpha', + 'default' => 'rgba(0,0,0,.3)', + 'transport' => 'refresh', // refresh or postMessage. + ) +); + +$wp_customize->add_control( + new coletivo_Alpha_Color_Control( + $wp_customize, + 'coletivo_hero_overlay_color', + array( + 'label' => esc_html__( 'Background Overlay Color', 'coletivo' ), + 'section' => 'coletivo_hero_images', + 'priority' => 130, + ) + ) +); + +// Parallax. +$wp_customize->add_setting( + 'coletivo_hero_parallax', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => 0, + 'transport' => 'refresh', // refresh or postMessage. + ) +); + +$wp_customize->add_control( + 'coletivo_hero_parallax', + array( + 'label' => esc_html__( 'Enable parallax effect (apply for first BG image only)', 'coletivo' ), + 'section' => 'coletivo_hero_images', + 'type' => 'checkbox', + 'priority' => 50, + 'description' => '', + ) +); + +$wp_customize->add_section( + 'coletivo_hero_content_layout1', + array( + 'priority' => 9, + 'title' => esc_html__( 'Hero Content Layout', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_hero_panel', + ) +); + +// Hero Layout. +$wp_customize->add_setting( + 'coletivo_hero_layout', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '1', + ) +); + +$wp_customize->add_control( + 'coletivo_hero_layout', + array( + 'label' => esc_html__( 'Display Layout', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + 'description' => '', + 'type' => 'select', + 'choices' => array( + '1' => esc_html__( 'Layout 1', 'coletivo' ), + '2' => esc_html__( 'Layout 2', 'coletivo' ), + ), + ) +); + +// For Hero layout. +// Large Text. +$wp_customize->add_setting( + 'coletivo_hcl1_largetext', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'mod' => 'html', + 'default' => __( 'We are coletivo | One Page | Responsive | Perfection', 'coletivo' ), + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_hcl1_largetext', + array( + 'label' => esc_html__( 'Large Text', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + 'description' => esc_html__( 'Text Rotating Guide: Put your rotate texts separate by "|" into ..., go to Customizer->Site Option->Animate to control rotate animation.', 'coletivo' ), + ) + ) +); + +// Small Text. +$wp_customize->add_setting( + 'coletivo_hcl1_smalltext', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => __( 'Morbi tempus porta nunc pharetra quisque ligula imperdiet posuere
    vitae felis proin sagittis leo ac tellus blandit sollicitudin quisque vitae placerat.', 'coletivo' ), + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_hcl1_smalltext', + array( + 'label' => esc_html__( 'Small Text', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + 'mod' => 'html', + 'description' => esc_html__( 'You can use text rotate slider in this textarea too.', 'coletivo' ), + ) + ) +); + +// Button #1 Text. +$wp_customize->add_setting( + 'coletivo_hcl1_btn1_text', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'About Us', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_hcl1_btn1_text', + array( + 'label' => esc_html__( 'Button #1 Text', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + ) +); + +// Button #1 Link. +$wp_customize->add_setting( + 'coletivo_hcl1_btn1_link', + array( + 'sanitize_callback' => 'esc_url', + 'default' => esc_url( home_url( '/' ) ) . esc_html__( '#about', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_hcl1_btn1_link', + array( + 'label' => esc_html__( 'Button #1 Link', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + ) +); + +// Button #1 Style. +$wp_customize->add_setting( + 'coletivo_hcl1_btn1_style', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => 'btn-theme-primary', + ) +); + +$wp_customize->add_control( + 'coletivo_hcl1_btn1_style', + array( + 'label' => esc_html__( 'Button #1 style', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + 'type' => 'select', + 'choices' => array( + 'btn-theme-primary' => esc_html__( 'Button Primary', 'coletivo' ), + 'btn-secondary-outline' => esc_html__( 'Button Secondary', 'coletivo' ), + 'btn-default' => esc_html__( 'Button', 'coletivo' ), + 'btn-primary' => esc_html__( 'Primary', 'coletivo' ), + 'btn-success' => esc_html__( 'Success', 'coletivo' ), + 'btn-info' => esc_html__( 'Info', 'coletivo' ), + 'btn-warning' => esc_html__( 'Warning', 'coletivo' ), + 'btn-danger' => esc_html__( 'Danger', 'coletivo' ), + ), + ) +); + +// Button #2 Text. +$wp_customize->add_setting( + 'coletivo_hcl1_btn2_text', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'Get Started', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_hcl1_btn2_text', + array( + 'label' => esc_html__( 'Button #2 Text', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + ) +); + +// Button #2 Link. +$wp_customize->add_setting( + 'coletivo_hcl1_btn2_link', + array( + 'sanitize_callback' => 'esc_url', + 'default' => esc_url( home_url( '/' ) ) . esc_html__( '#contact', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_hcl1_btn2_link', + array( + 'label' => esc_html__( 'Button #2 Link', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + ) +); + +// Button #2 Style. +$wp_customize->add_setting( + 'coletivo_hcl1_btn2_style', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => 'btn-secondary-outline', + ) +); + +$wp_customize->add_control( + 'coletivo_hcl1_btn2_style', + array( + 'label' => esc_html__( 'Button #1 style', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + 'type' => 'select', + 'choices' => array( + 'btn-theme-primary' => esc_html__( 'Button Primary', 'coletivo' ), + 'btn-secondary-outline' => esc_html__( 'Button Secondary', 'coletivo' ), + 'btn-default' => esc_html__( 'Button', 'coletivo' ), + 'btn-primary' => esc_html__( 'Primary', 'coletivo' ), + 'btn-success' => esc_html__( 'Success', 'coletivo' ), + 'btn-info' => esc_html__( 'Info', 'coletivo' ), + 'btn-warning' => esc_html__( 'Warning', 'coletivo' ), + 'btn-danger' => esc_html__( 'Danger', 'coletivo' ), + ), + ) +); + +// Layout 2. +// Layout 2 content text. +$wp_customize->add_setting( + 'coletivo_hcl2_content', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'mod' => 'html', + 'default' => wp_kses_post( '

    Business Website' . "\n" . 'Made Simple.

    ' . "\n" . 'We provide creative solutions to clients around the world,' . "\n" . 'creating things that get attention and meaningful.' . "\n\n" . 'Get Started' ), + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_hcl2_content', + array( + 'label' => esc_html__( 'Content Text', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + 'description' => '', + ) + ) +); + +// Layout 2 image. +$wp_customize->add_setting( + 'coletivo_hcl2_image', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'mod' => 'html', + 'default' => get_template_directory_uri() . '/assets/images/coletivo_responsive.png', + ) +); + +$wp_customize->add_control( + new WP_Customize_Image_Control( + $wp_customize, + 'coletivo_hcl2_image', + array( + 'label' => esc_html__( 'Image', 'coletivo' ), + 'section' => 'coletivo_hero_content_layout1', + 'description' => '', + ) + ) +); diff --git a/inc/customizer-components/customizer-section-news.php b/inc/customizer-components/customizer-section-news.php new file mode 100644 index 0000000..9e4310e --- /dev/null +++ b/inc/customizer-components/customizer-section-news.php @@ -0,0 +1,197 @@ +add_panel( + 'coletivo_news', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_news' ), + 'title' => esc_html__( 'Section: News', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_section( + 'coletivo_news_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_news', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_news_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_news_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_news_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_news_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'news', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_news_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_news_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_news_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Latest News', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_news_title', + array( + 'label' => esc_html__( 'Section Title', 'coletivo' ), + 'section' => 'coletivo_news_settings', + 'description' => '', + ) +); + +// Sub Title. +$wp_customize->add_setting( + 'coletivo_news_subtitle', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Section subtitle', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_news_subtitle', + array( + 'label' => esc_html__( 'Section Subtitle', 'coletivo' ), + 'section' => 'coletivo_news_settings', + 'description' => '', + ) +); + +// Description. +$wp_customize->add_setting( + 'coletivo_news_desc', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_news_desc', + array( + 'label' => esc_html__( 'Section Description', 'coletivo' ), + 'section' => 'coletivo_news_settings', + 'description' => '', + ) + ) +); + +// hr. +$wp_customize->add_setting( + 'coletivo_news_settings_hr', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + ) +); + +$wp_customize->add_control( + new coletivo_Misc_Control( + $wp_customize, + 'coletivo_news_settings_hr', + array( + 'section' => 'coletivo_news_settings', + 'type' => 'hr', + ) + ) +); + +// Number of post to show. +$wp_customize->add_setting( + 'coletivo_news_number', + array( + 'sanitize_callback' => 'coletivo_sanitize_number', + 'default' => '3', + ) +); + +$wp_customize->add_control( + 'coletivo_news_number', + array( + 'label' => esc_html__( 'Number of post to show', 'coletivo' ), + 'section' => 'coletivo_news_settings', + 'description' => '', + ) +); + +// Blog Button. +$wp_customize->add_setting( + 'coletivo_news_more_link', + array( + 'sanitize_callback' => 'esc_url', + 'default' => '#', + ) +); + +$wp_customize->add_control( + 'coletivo_news_more_link', + array( + 'label' => esc_html__( 'More News button link', 'coletivo' ), + 'section' => 'coletivo_news_settings', + 'description' => esc_html__( 'It should be your blog page link.', 'coletivo' ), + ) +); + +$wp_customize->add_setting( + 'coletivo_news_more_text', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Read Our Blog', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_news_more_text', + array( + 'label' => esc_html__( 'More News Button Text', 'coletivo' ), + 'section' => 'coletivo_news_settings', + 'description' => '', + ) +); diff --git a/inc/customizer-components/customizer-section-portfolio.php b/inc/customizer-components/customizer-section-portfolio.php new file mode 100644 index 0000000..a095bf0 --- /dev/null +++ b/inc/customizer-components/customizer-section-portfolio.php @@ -0,0 +1,188 @@ +add_panel( + 'coletivo_portfolio', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_portfolio' ), + 'title' => esc_html__( 'Section: Portfolio', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_is_jetpack_active', + ) +); + +$wp_customize->add_section( + 'coletivo_portfolio_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_portfolio', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_portfolio_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_portfolio_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_portfolio_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_portfolio_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'portfolio', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_portfolio_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_portfolio_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +// Number of projects to show.. +$wp_customize->add_setting( + 'coletivo_portfolio_number', + array( + 'sanitize_callback' => 'coletivo_sanitize_number', + 'default' => '3', + ) +); + +$wp_customize->add_control( + 'coletivo_portfolio_number', + array( + 'label' => esc_html__( 'Number of projects to show', 'coletivo' ), + 'section' => 'coletivo_portfolio_settings', + 'description' => '', + ) +); + +$wp_customize->add_section( + 'coletivo_portfolio_content', + array( + 'priority' => 6, + 'title' => esc_html__( 'Section Content', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_portfolio', + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_portfolio_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Our Work', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_portfolio_title', + array( + 'label' => esc_html__( 'Section Title', 'coletivo' ), + 'section' => 'coletivo_portfolio_content', + 'description' => '', + ) +); + +// Sub Title. +$wp_customize->add_setting( + 'coletivo_portfolio_subtitle', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Section subtitle', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_portfolio_subtitle', + array( + 'label' => esc_html__( 'Section Subtitle', 'coletivo' ), + 'section' => 'coletivo_portfolio_content', + 'description' => '', + ) +); + +// Description. +$wp_customize->add_setting( + 'coletivo_portfolio_desc', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_portfolio_desc', + array( + 'label' => esc_html__( 'Section Description', 'coletivo' ), + 'section' => 'coletivo_portfolio_content', + 'description' => '', + ) + ) +); + +// Portfolio Button. +$wp_customize->add_setting( + 'coletivo_portfolio_more_link', + array( + 'sanitize_callback' => 'esc_url', + 'default' => '#', + ) +); + +$wp_customize->add_control( + 'coletivo_portfolio_more_link', + array( + 'label' => esc_html__( 'Portfolio Button Link', 'coletivo' ), + 'section' => 'coletivo_portfolio_content', + 'description' => esc_html__( 'It should be your portfolio page link.', 'coletivo' ), + ) +); + +$wp_customize->add_setting( + 'coletivo_portfolio_more_text', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'See Our Portfolio', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_portfolio_more_text', + array( + 'label' => esc_html__( 'Portfolio Button Text', 'coletivo' ), + 'section' => 'coletivo_portfolio_content', + 'description' => '', + ) +); diff --git a/inc/customizer-components/customizer-section-sections.php b/inc/customizer-components/customizer-section-sections.php new file mode 100644 index 0000000..debda6c --- /dev/null +++ b/inc/customizer-components/customizer-section-sections.php @@ -0,0 +1,64 @@ +add_section( + 'coletivo_sections_options', + array( + 'priority' => 130, + 'title' => esc_html__( 'Sections', 'coletivo' ), + 'description' => '', + ) +); + +// Sections ordering. +$wp_customize->add_setting( + 'coletivo_section_order', + array( + 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', + 'transport' => 'refresh', // refresh or postMessage. + ) +); + +$wp_customize->add_control( + new coletivo_Customize_Repeatable_Control( + $wp_customize, + 'coletivo_section_order', + array( + 'label' => esc_html__( 'Sections', 'coletivo' ), + 'is_order_field' => true, + 'description' => esc_html__( 'Organize with drag and drop to define sections order, open it to customize each one', 'coletivo' ), + 'section' => 'coletivo_sections_options', + 'live_title_id' => 'section_order', // apply for unput text and textarea only. + 'title_format' => __( '[live_title] (Edit Section)', 'coletivo' ), + 'max_item' => 200, // Maximum item can add. + 'limited_msg' => '', + 'fields' => array(), + + ) + ) +); + +// Hidden field to reorder home sections. +$wp_customize->add_setting( + 'coletivo_sections_order', + array( + 'default' => apply_filters( 'coletivo_sections_order_default_value', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ), + ) +); + +$wp_customize->add_control( + 'coletivo_sections_order', + array( + 'type' => 'hidden', + 'section' => 'coletivo_sections_options', + ) +); diff --git a/inc/customizer-components/customizer-section-services.php b/inc/customizer-components/customizer-section-services.php new file mode 100644 index 0000000..4308876 --- /dev/null +++ b/inc/customizer-components/customizer-section-services.php @@ -0,0 +1,213 @@ +add_panel( + 'coletivo_services', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_services' ), + 'title' => esc_html__( 'Section: Services', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_section( + 'coletivo_service_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_services', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_services_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_services_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_service_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_services_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'services', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_services_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_service_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_services_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Our Services', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_services_title', + array( + 'label' => esc_html__( 'Section Title', 'coletivo' ), + 'section' => 'coletivo_service_settings', + 'description' => '', + ) +); + +// Sub Title. +$wp_customize->add_setting( + 'coletivo_services_subtitle', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Section subtitle', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_services_subtitle', + array( + 'label' => esc_html__( 'Section Subtitle', 'coletivo' ), + 'section' => 'coletivo_service_settings', + 'description' => '', + ) +); + +// Description. +$wp_customize->add_setting( + 'coletivo_services_desc', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_services_desc', + array( + 'label' => esc_html__( 'Section Description', 'coletivo' ), + 'section' => 'coletivo_service_settings', + 'description' => '', + ) + ) +); + +// Services layout. +$wp_customize->add_setting( + 'coletivo_service_layout', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => '6', + ) +); + +$wp_customize->add_control( + 'coletivo_service_layout', + array( + 'label' => esc_html__( 'Services Layout Setting', 'coletivo' ), + 'section' => 'coletivo_service_settings', + 'description' => '', + 'type' => 'select', + 'choices' => array( + '3' => esc_html__( '4 Columns', 'coletivo' ), + '4' => esc_html__( '3 Columns', 'coletivo' ), + '6' => esc_html__( '2 Columns', 'coletivo' ), + ), + ) +); + +$wp_customize->add_section( + 'coletivo_service_content', + array( + 'priority' => 6, + 'title' => esc_html__( 'Section Content', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_services', + ) +); + +// Section service content. +$wp_customize->add_setting( + 'coletivo_services', + array( + 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', + 'transport' => 'refresh', // refresh or postMessage. + ) +); + +$wp_customize->add_control( + new coletivo_Customize_Repeatable_Control( + $wp_customize, + 'coletivo_services', + array( + 'label' => esc_html__( 'Service content', 'coletivo' ), + 'description' => '', + 'section' => 'coletivo_service_content', + 'live_title_id' => 'content_page', // apply for unput text and textarea only. + 'title_format' => esc_html__( '[live_title]', 'coletivo' ), + 'max_item' => 12, // Maximum item can add. + 'limited_msg' => esc_html__( 'Only 12 Services highlights allowed ', 'coletivo' ), + 'fields' => array( + 'icon_type' => array( + 'title' => esc_html__( 'Custom icon', 'coletivo' ), + 'type' => 'select', + 'options' => array( + 'icon' => esc_html__( 'Icon', 'coletivo' ), + 'image' => esc_html__( 'image', 'coletivo' ), + ), + ), + 'icon' => array( + 'title' => esc_html__( 'Icon', 'coletivo' ), + 'type' => 'icon', + 'required' => array( 'icon_type', '=', 'icon' ), + ), + 'image' => array( + 'title' => esc_html__( 'Image', 'coletivo' ), + 'type' => 'media', + 'required' => array( 'icon_type', '=', 'image' ), + ), + 'content_page' => array( + 'title' => esc_html__( 'Select a page', 'coletivo' ), + 'type' => 'select', + 'options' => $option_pages, + ), + 'enable_link' => array( + 'title' => esc_html__( 'Link to single page', 'coletivo' ), + 'type' => 'checkbox', + ), + ), + ) + ) +); diff --git a/inc/customizer-components/customizer-section-slider.php b/inc/customizer-components/customizer-section-slider.php new file mode 100644 index 0000000..d11521d --- /dev/null +++ b/inc/customizer-components/customizer-section-slider.php @@ -0,0 +1,132 @@ +add_panel( + 'coletivo_yourslider', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_yourslider' ), + 'title' => esc_html__( 'Section: Your Slider', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_section( + 'coletivo_yourslider_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_yourslider', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_yourslider_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_yourslider_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_yourslider_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_yourslider_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'yourslider', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_yourslider_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_yourslider_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +$wp_customize->add_section( + 'coletivo_yourslider_content', + array( + 'priority' => 6, + 'title' => esc_html__( 'Section Content', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_yourslider', + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_yourslider_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Your Slider', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_yourslider_title', + array( + 'label' => esc_html__( 'Section Title', 'coletivo' ), + 'section' => 'coletivo_yourslider_content', + 'description' => '', + ) +); + +// Sub Title. +$wp_customize->add_setting( + 'coletivo_yourslider_subtitle', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'See all we Do', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_yourslider_subtitle', + array( + 'label' => esc_html__( 'Section Subtitle', 'coletivo' ), + 'section' => 'coletivo_yourslider_content', + 'description' => '', + ) +); + +// Description. +$wp_customize->add_setting( + 'coletivo_yourslider_shortcode', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_yourslider_shortcode', + array( + 'label' => esc_html__( 'Slider Shortcode', 'coletivo' ), + 'section' => 'coletivo_yourslider_content', + 'description' => __( 'In order to display a Slider install the plugin of your preference and then copy the shortcode and paste it here, the shortcode will be like this [metaslider id=XXX] or this [brasa_slider id="123"]', 'coletivo' ), + ) +); diff --git a/inc/customizer-components/customizer-section-social.php b/inc/customizer-components/customizer-section-social.php new file mode 100644 index 0000000..3989f5b --- /dev/null +++ b/inc/customizer-components/customizer-section-social.php @@ -0,0 +1,162 @@ +add_panel( + 'coletivo_social_panel', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_social_panel' ), + 'title' => esc_html__( 'Section: Social', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +// Social settings. +$wp_customize->add_section( + 'coletivo_social_settings', + array( + 'priority' => 1, + 'title' => esc_html__( 'Social Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_social_panel', + ) +); + +// Disable Social. +$wp_customize->add_setting( + 'coletivo_social_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '1', + ) +); + +$wp_customize->add_control( + 'coletivo_social_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide Footer Social?', 'coletivo' ), + 'section' => 'coletivo_social_settings', + 'description' => esc_html__( 'Check this box to hide footer social section.', 'coletivo' ), + ) +); + +$wp_customize->add_setting( + 'coletivo_social_footer_guide', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + ) +); + +$wp_customize->add_setting( + 'coletivo_social_footer_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Keep Updated', 'coletivo' ), + 'transport' => 'postMessage', + ) +); + +// Social Title. +$wp_customize->add_control( + 'coletivo_social_footer_title', + array( + 'label' => esc_html__( 'Social Footer Title', 'coletivo' ), + 'section' => 'coletivo_social_settings', + 'description' => '', + ) +); + +// Social BG color. +$wp_customize->add_setting( + 'coletivo_footer_bg', + array( + 'sanitize_callback' => 'sanitize_hex_color_no_hash', + 'sanitize_js_callback' => 'maybe_hash_hex_color', + 'default' => '#939393', + 'transport' => 'postMessage', + ) +); + +$wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'coletivo_footer_bg', + array( + 'label' => esc_html__( 'Footer Background', 'coletivo' ), + 'section' => 'coletivo_social_settings', + 'description' => '', + ) + ) +); + +$wp_customize->add_section( + 'coletivo_social', + array( + 'priority' => 2, + 'title' => esc_html__( 'Social Profiles', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_social_panel', + ) +); + +// Custom Message. +$wp_customize->add_control( + new coletivo_Misc_Control( + $wp_customize, + 'coletivo_social_footer_guide', + array( + 'section' => 'coletivo_social', + 'type' => 'custom_message', + 'description' => esc_html__( 'These social profiles setting below will display at the footer of your site.', 'coletivo' ), + ) + ) +); + +// Social Profiles. +$wp_customize->add_setting( + 'coletivo_social_profiles', + array( + 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', + 'transport' => 'postMessage', // refresh or postMessage. + ) +); + +$wp_customize->add_control( + new coletivo_Customize_Repeatable_Control( + $wp_customize, + 'coletivo_social_profiles', + array( + 'label' => esc_html__( 'Socials', 'coletivo' ), + 'description' => '', + 'section' => 'coletivo_social', + 'live_title_id' => 'network', // apply for unput text and textarea only. + 'title_format' => esc_html__( '[live_title]', 'coletivo' ), + 'max_item' => 9, // Maximum item can add. + 'limited_msg' => esc_html__( 'Only 9 social networks allowed', 'coletivo' ), + 'fields' => array( + 'network' => array( + 'title' => esc_html__( 'Social network', 'coletivo' ), + 'type' => 'text', + ), + 'icon' => array( + 'title' => esc_html__( 'Icon', 'coletivo' ), + 'type' => 'icon', + ), + 'link' => array( + 'title' => esc_html__( 'URL', 'coletivo' ), + 'type' => 'text', + ), + ), + ) + ) +); diff --git a/inc/customizer-components/customizer-section-team.php b/inc/customizer-components/customizer-section-team.php new file mode 100644 index 0000000..c443a87 --- /dev/null +++ b/inc/customizer-components/customizer-section-team.php @@ -0,0 +1,195 @@ +add_panel( + 'coletivo_team', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_team' ), + 'title' => esc_html__( 'Section: Team', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_section( + 'coletivo_team_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_team', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_team_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_team_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_team_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_team_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => esc_html__( 'team', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_team_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_team_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_team_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Our Team', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_team_title', + array( + 'label' => esc_html__( 'Section Title', 'coletivo' ), + 'section' => 'coletivo_team_settings', + 'description' => '', + ) +); + +// Sub Title. +$wp_customize->add_setting( + 'coletivo_team_subtitle', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => esc_html__( 'Section subtitle', 'coletivo' ), + ) +); + +$wp_customize->add_control( + 'coletivo_team_subtitle', + array( + 'label' => esc_html__( 'Section Subtitle', 'coletivo' ), + 'section' => 'coletivo_team_settings', + 'description' => '', + ) +); + +// Description. +$wp_customize->add_setting( + 'coletivo_team_desc', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_team_desc', + array( + 'label' => esc_html__( 'Section Description', 'coletivo' ), + 'section' => 'coletivo_team_settings', + 'description' => '', + ) + ) +); + +// Team layout. +$wp_customize->add_setting( + 'coletivo_team_layout', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => '3', + ) +); + +$wp_customize->add_control( + 'coletivo_team_layout', + array( + 'label' => esc_html__( 'Team Layout Setting', 'coletivo' ), + 'section' => 'coletivo_team_settings', + 'description' => '', + 'type' => 'select', + 'choices' => array( + '3' => esc_html__( '4 Columns', 'coletivo' ), + '4' => esc_html__( '3 Columns', 'coletivo' ), + '6' => esc_html__( '2 Columns', 'coletivo' ), + ), + ) +); + +$wp_customize->add_section( + 'coletivo_team_content', + array( + 'priority' => 6, + 'title' => esc_html__( 'Section Content', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_team', + ) +); + +// Team member settings. +$wp_customize->add_setting( + 'coletivo_team_members', + array( + 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', + 'transport' => 'refresh', // refresh or postMessage. + ) +); + +$wp_customize->add_control( + new coletivo_Customize_Repeatable_Control( + $wp_customize, + 'coletivo_team_members', + array( + 'label' => esc_html__( 'Team members', 'coletivo' ), + 'description' => '', + 'section' => 'coletivo_team_content', + 'title_format' => esc_html__( '[live_title]', 'coletivo' ), + 'max_item' => 12, // Maximum item can add. + 'limited_msg' => esc_html__( 'Only 12 members allowed', 'coletivo' ), + 'fields' => array( + 'user_id' => array( + 'title' => esc_html__( 'User media', 'coletivo' ), + 'type' => 'media', + 'desc' => '', + ), + 'link' => array( + 'title' => esc_html__( 'Custom Link', 'coletivo' ), + 'type' => 'text', + 'desc' => '', + ), + ), + ) + ) +); diff --git a/inc/customizer-components/customizer-section-video-lightbox.php b/inc/customizer-components/customizer-section-video-lightbox.php new file mode 100644 index 0000000..b8d3f0b --- /dev/null +++ b/inc/customizer-components/customizer-section-video-lightbox.php @@ -0,0 +1,145 @@ +add_panel( + 'coletivo_videolightbox', + array( + 'priority' => coletivo_get_customizer_priority( 'coletivo_videolightbox' ), + 'title' => esc_html__( 'Section: Video Lightbox', 'coletivo' ), + 'description' => '', + 'active_callback' => 'coletivo_showon_frontpage', + ) +); + +$wp_customize->add_section( + 'coletivo_videolightbox_settings', + array( + 'priority' => 3, + 'title' => esc_html__( 'Section Settings', 'coletivo' ), + 'description' => '', + 'panel' => 'coletivo_videolightbox', + ) +); + +// Show Content. +$wp_customize->add_setting( + 'coletivo_videolightbox_disable', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_videolightbox_disable', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Hide this section?', 'coletivo' ), + 'section' => 'coletivo_videolightbox_settings', + 'description' => esc_html__( 'Check this box to hide this section.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_videolightbox_section_title', + array( + 'sanitize_callback' => 'sanitize_text_field', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_videolightbox_section_title', + array( + 'label' => esc_html__( 'Title section in customizer', 'coletivo' ), + 'section' => 'coletivo_videolightbox_settings', + 'description' => esc_html__( 'This title is only showed in customizer', 'coletivo' ), + ) +); + +// Section ID. +$wp_customize->add_setting( + 'coletivo_videolightbox_id', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => 'videolightbox', + ) +); + +$wp_customize->add_control( + 'coletivo_videolightbox_id', + array( + 'label' => esc_html__( 'Section ID:', 'coletivo' ), + 'section' => 'coletivo_videolightbox_settings', + 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ), + ) +); + +// Title. +$wp_customize->add_setting( + 'coletivo_videolightbox_title', + array( + 'sanitize_callback' => 'coletivo_sanitize_text', + 'default' => '', + ) +); + +$wp_customize->add_control( + new coletivo_Editor_Custom_Control( + $wp_customize, + 'coletivo_videolightbox_title', + array( + 'label' => esc_html__( 'Section heading', 'coletivo' ), + 'section' => 'coletivo_videolightbox_settings', + 'description' => '', + ) + ) +); + +// Video URL. +$wp_customize->add_setting( + 'coletivo_videolightbox_url', + array( + 'sanitize_callback' => 'esc_url_raw', + 'default' => '', + ) +); + +$wp_customize->add_control( + 'coletivo_videolightbox_url', + array( + 'label' => esc_html__( 'Video url', 'coletivo' ), + 'section' => 'coletivo_videolightbox_settings', + 'description' => esc_html__( 'Paste Youtube or Vimeo url here', 'coletivo' ), + ) +); + +// Parallax image. +$wp_customize->add_setting( + 'coletivo_videolightbox_image', + array( + 'sanitize_callback' => 'esc_url_raw', + 'default' => '', + ) +); + +$wp_customize->add_control( + new WP_Customize_Image_Control( + $wp_customize, + 'coletivo_videolightbox_image', + array( + 'label' => esc_html__( 'Background image', 'coletivo' ), + 'section' => 'coletivo_videolightbox_settings', + ) + ) +); diff --git a/inc/customizer-components/customizer-site-identity.php b/inc/customizer-components/customizer-site-identity.php new file mode 100644 index 0000000..9ff2038 --- /dev/null +++ b/inc/customizer-components/customizer-site-identity.php @@ -0,0 +1,46 @@ +add_setting( + 'coletivo_hide_sitetitle', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => $is_old_logo ? 1 : 0, + ) +); + +$wp_customize->add_control( + 'coletivo_hide_sitetitle', + array( + 'label' => esc_html__( 'Hide site title', 'coletivo' ), + 'section' => 'title_tagline', + 'type' => 'checkbox', + ) +); + +$wp_customize->add_setting( + 'coletivo_hide_tagline', + array( + 'sanitize_callback' => 'coletivo_sanitize_checkbox', + 'default' => $is_old_logo ? 1 : 0, + ) +); + +$wp_customize->add_control( + 'coletivo_hide_tagline', + array( + 'label' => esc_html__( 'Hide site tagline', 'coletivo' ), + 'section' => 'title_tagline', + 'type' => 'checkbox', + ) +); diff --git a/inc/customizer-components/customizer-site-options.php b/inc/customizer-components/customizer-site-options.php new file mode 100644 index 0000000..6d5d1a6 --- /dev/null +++ b/inc/customizer-components/customizer-site-options.php @@ -0,0 +1,22 @@ +add_panel( + 'theme_options', + array( + 'priority' => 22, + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => esc_html__( 'Theme Options', 'coletivo' ), + 'description' => '', + ) +); diff --git a/inc/customizer.php b/inc/customizer.php index 1904d75..63f808d 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -1,2861 +1,299 @@ remove_section( 'colors' ); - $wp_customize->remove_section( 'background_image' ); - // Custom WP default control & settings. - $wp_customize->get_section( 'title_tagline' )->title = esc_html__('Site Title, Tagline & Logo', 'coletivo'); - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; - $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; - /** - * Hook to add other customize - */ - do_action( 'coletivo_customize_before_register', $wp_customize ); - $pages = get_pages(); - $option_pages = array(); - $option_pages[0] = __( 'Select page', 'coletivo' ); - foreach( $pages as $p ){ - $option_pages[ $p->ID ] = $p->post_title; - } - $users = get_users( array( - 'orderby' => 'display_name', - 'order' => 'ASC', - 'number' => '', - ) ); - $option_users[0] = __( 'Select member', 'coletivo' ); - foreach( $users as $user ){ - $option_users[ $user->ID ] = $user->display_name; - } - /*------------------------------------------------------------------------*/ - /* Site Identity. - /*------------------------------------------------------------------------*/ - $is_old_logo = get_theme_mod( 'coletivo_site_image_logo' ); - $wp_customize->add_setting( 'coletivo_hide_sitetitle', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => $is_old_logo ? 1: 0, - ) - ); - $wp_customize->add_control( - 'coletivo_hide_sitetitle', - array( - 'label' => esc_html__('Hide site title', 'coletivo'), - 'section' => 'title_tagline', - 'type' => 'checkbox', - ) - ); - $wp_customize->add_setting( 'coletivo_hide_tagline', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => $is_old_logo ? 1: 0, - ) - ); - $wp_customize->add_control( - 'coletivo_hide_tagline', - array( - 'label' => esc_html__('Hide site tagline', 'coletivo'), - 'section' => 'title_tagline', - 'type' => 'checkbox', - ) - ); - /*------------------------------------------------------------------------*/ - /* Site Options - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'theme_options', - array( - 'priority' => 22, - 'capability' => 'edit_theme_options', - 'theme_supports' => '', - 'title' => esc_html__( 'Theme Options', 'coletivo' ), - 'description' => '', - ) - ); - /* Global Settings - ----------------------------------------------------------------------*/ - $wp_customize->add_section( 'coletivo_global_settings' , - array( - 'priority' => 1, - 'title' => esc_html__( 'Global', 'coletivo' ), - 'description' => '', - 'panel' => 'theme_options', - ) - ); - - // Primary Color - $wp_customize->add_setting( 'coletivo_primary_color', array('sanitize_callback' => 'sanitize_hex_color_no_hash', 'sanitize_js_callback' => 'maybe_hash_hex_color', 'default' => '#03c4eb' ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'coletivo_primary_color', - array( - 'label' => esc_html__( 'Primary Color', 'coletivo' ), - 'section' => 'coletivo_global_settings', - 'description' => '', - 'priority' => 1 - ) - )); - - - // Disable Animation - $wp_customize->add_setting( 'coletivo_animation_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_animation_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Disable animation effect?', 'coletivo'), - 'section' => 'coletivo_global_settings', - 'description' => esc_html__('Check this box to disable all element animation when scroll.', 'coletivo') - ) - ); - - // Header Transparent - $wp_customize->add_setting( 'coletivo_header_transparent', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_control( 'coletivo_header_transparent', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Header Transparent', 'coletivo'), - 'section' => 'coletivo_global_settings', - 'description' => esc_html__('Apply for front page template only.', 'coletivo') - ) - ); - - /* Header - ----------------------------------------------------------------------*/ - $wp_customize->add_section( 'coletivo_header_settings' , - array( - 'priority' => 5, - 'title' => esc_html__( 'Header', 'coletivo' ), - 'description' => '', - 'panel' => 'theme_options', - ) - ); - // Hidden field to reorder home sections - $wp_customize->add_setting( 'coletivo_sections_order', - array( - 'default' => apply_filters( 'coletivo_sections_order_default_value', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ) - ) ); - $wp_customize->add_control( 'coletivo_sections_order', - array( - 'type' => 'hidden', - 'section' => 'coletivo_header_settings' - ) - ); - // Header BG Color - $wp_customize->add_setting( 'coletivo_header_bg_color', - array( - 'sanitize_callback' => 'sanitize_hex_color_no_hash', - 'sanitize_js_callback' => 'maybe_hash_hex_color', - 'default' => '' - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'coletivo_header_bg_color', - array( - 'label' => esc_html__( 'Background Color', 'coletivo' ), - 'section' => 'coletivo_header_settings', - 'description' => '', - ) - )); - // Site Title Color - $wp_customize->add_setting( 'coletivo_logo_text_color', - array( - 'sanitize_callback' => 'sanitize_hex_color_no_hash', - 'sanitize_js_callback' => 'maybe_hash_hex_color', - 'default' => '' - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'coletivo_logo_text_color', - array( - 'label' => esc_html__( 'Site Title Color', 'coletivo' ), - 'section' => 'coletivo_header_settings', - 'description' => esc_html__( 'Only set if you don\'t use an image logo.', 'coletivo' ), - ) - )); - // Header Menu Color - $wp_customize->add_setting( 'coletivo_menu_color', - array( - 'sanitize_callback' => 'sanitize_hex_color_no_hash', - 'sanitize_js_callback' => 'maybe_hash_hex_color', - 'default' => '' - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'coletivo_menu_color', - array( - 'label' => esc_html__( 'Menu Link Color', 'coletivo' ), - 'section' => 'coletivo_header_settings', - 'description' => '', - ) - )); - // Header Menu Hover Color - $wp_customize->add_setting( 'coletivo_menu_hover_color', - array( - 'sanitize_callback' => 'sanitize_hex_color_no_hash', - 'sanitize_js_callback' => 'maybe_hash_hex_color', - 'default' => '' - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'coletivo_menu_hover_color', - array( - 'label' => esc_html__( 'Menu Link Hover/Active Color', 'coletivo' ), - 'section' => 'coletivo_header_settings', - 'description' => '', - ) - )); - // Header Menu Hover BG Color - $wp_customize->add_setting( 'coletivo_menu_hover_bg_color', - array( - 'sanitize_callback' => 'sanitize_hex_color_no_hash', - 'sanitize_js_callback' => 'maybe_hash_hex_color', - 'default' => '' - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'coletivo_menu_hover_bg_color', - array( - 'label' => esc_html__( 'Menu Link Hover/Active BG Color', 'coletivo' ), - 'section' => 'coletivo_header_settings', - 'description' => '', - ) - )); - // Reponsive Mobile button color - $wp_customize->add_setting( 'coletivo_menu_toggle_button_color', - array( - 'sanitize_callback' => 'sanitize_hex_color_no_hash', - 'sanitize_js_callback' => 'maybe_hash_hex_color', - 'default' => '' - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'coletivo_menu_toggle_button_color', - array( - 'label' => esc_html__( 'Responsive Menu Button Color', 'coletivo' ), - 'section' => 'coletivo_header_settings', - 'description' => '', - ) - )); - // Vertical align menu - $wp_customize->add_setting( 'coletivo_vertical_align_menu', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_vertical_align_menu', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Center vertical align for menu', 'coletivo'), - 'section' => 'coletivo_header_settings', - 'description' => esc_html__('If you use logo and your logo is too tall, check this box to auto vertical align menu.', 'coletivo') - ) - ); - - // Disable Sticky Header - $wp_customize->add_setting( 'coletivo_sticky_header_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_sticky_header_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Disable Sticky Header?', 'coletivo'), - 'section' => 'coletivo_header_settings', - 'description' => esc_html__('Check this box to disable sticky header when scroll.', 'coletivo') - ) - ); - - /* Footer - ----------------------------------------------------------------------*/ - $wp_customize->add_section( 'coletivo_footer_settings' , - array( - 'priority' => 10, - 'title' => esc_html__( 'Footer', 'coletivo' ), - 'description' => '', - 'panel' => 'theme_options', - ) - ); - - // Footer custom Text - $wp_customize->add_setting( 'coletivo_footer_text', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__( 'Few Rights Reserved', 'coletivo' ), - 'transport' => 'refresh', - ) - ); - $wp_customize->add_control( 'coletivo_footer_text', - array( - 'type' => 'text', - 'label' => esc_html__('Footer Text', 'coletivo'), - 'section' => 'coletivo_footer_settings', - 'description' => '' - ) - ); - // Footer custom Link - $wp_customize->add_setting( 'coletivo_footer_text_link', - array( - 'sanitize_callback' => 'esc_url', - 'default' => esc_url( home_url( '/' )), - 'transport' => 'refresh', - ) - ); - $wp_customize->add_control( 'coletivo_footer_text_link', - array( - 'type' =>'text', - 'label' => esc_html__('Footer Link', 'coletivo'), - 'section' => 'coletivo_footer_settings', - 'description' => '' - ) - ); - - // Footer Info BG Color - $wp_customize->add_setting( 'coletivo_footer_info_bg', array( - 'sanitize_callback' => 'sanitize_hex_color_no_hash', - 'sanitize_js_callback' => 'maybe_hash_hex_color', - 'default' => '', - 'transport' => 'postMessage' - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'coletivo_footer_info_bg', - array( - 'label' => esc_html__( 'Footer Info Background', 'coletivo' ), - 'section' => 'coletivo_footer_settings', - 'description' => '', - ) - )); - - // Disable Back to top - $wp_customize->add_setting( 'coletivo_btt_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - 'transport' => 'postMessage' - ) - ); - $wp_customize->add_control( 'coletivo_btt_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide footer back to top?', 'coletivo'), - 'section' => 'coletivo_footer_settings', - 'description' => esc_html__('Check this box to hide footer back to top button.', 'coletivo') - ) - ); - - /* Blog page Settings - ----------------------------------------------------------------------*/ - $wp_customize->add_section( 'coletivo_blog_page' , - array( - 'priority' => 15, - 'title' => esc_html__( 'Blog Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'theme_options' - ) - ); - $wp_customize->add_setting( 'coletivo_blog_page_style', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_blog_page_style', - array( - 'label' => esc_html__( 'Blog style', 'coletivo' ), - 'section' => 'coletivo_blog_page', - 'description' => '', - 'type' => 'radio', - 'default' => 'grid', - 'choices' => array( - 'grid' => __( 'Grid', 'coletivo'), - 'list' => __( 'List', 'coletivo' ), - ), - ) - ); - - /* Hero options - ----------------------------------------------------------------------*/ - $wp_customize->add_section( - 'coletivo_hero_options', - array( - 'title' => __( 'Hero Options', 'coletivo' ), - 'panel' => 'theme_options', - 'priority' => 20, - ) - ); - $wp_customize->add_setting( - 'coletivo_hero_option_animation', - array( - 'default' => 'flipInX', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - /** - * @see https://github.com/daneden/animate.css - */ - $animations_css = 'bounce flash pulse rubberBand shake headShake swing tada wobble jello bounceIn bounceInDown bounceInLeft bounceInRight bounceInUp bounceOut bounceOutDown bounceOutLeft bounceOutRight bounceOutUp fadeIn fadeInDown fadeInDownBig fadeInLeft fadeInLeftBig fadeInRight fadeInRightBig fadeInUp fadeInUpBig fadeOut fadeOutDown fadeOutDownBig fadeOutLeft fadeOutLeftBig fadeOutRight fadeOutRightBig fadeOutUp fadeOutUpBig flipInX flipInY flipOutX flipOutY lightSpeedIn lightSpeedOut rotateIn rotateInDownLeft rotateInDownRight rotateInUpLeft rotateInUpRight rotateOut rotateOutDownLeft rotateOutDownRight rotateOutUpLeft rotateOutUpRight hinge rollIn rollOut zoomIn zoomInDown zoomInLeft zoomInRight zoomInUp zoomOut zoomOutDown zoomOutLeft zoomOutRight zoomOutUp slideInDown slideInLeft slideInRight slideInUp slideOutDown slideOutLeft slideOutRight slideOutUp'; - $animations_css = explode( ' ', $animations_css ); - $animations = array(); - foreach ( $animations_css as $v ) { - $v = trim( $v ); - if ( $v ){ - $animations[ $v ]= $v; - } - } - $wp_customize->add_control( - 'coletivo_hero_option_animation', - array( - 'label' => __( 'Text animation', 'coletivo' ), - 'section' => 'coletivo_hero_options', - 'type' => 'select', - 'choices' => $animations, - ) - ); - $wp_customize->add_setting( - 'coletivo_hero_option_speed', - array( - 'default' => '5000', - 'sanitize_callback' => 'sanitize_text_field', - ) - ); - $wp_customize->add_control( - 'coletivo_hero_option_speed', - array( - 'label' => __( 'Speed', 'coletivo' ), - 'description' => esc_html__( 'The delay between the changing of each phrase in milliseconds.', 'coletivo' ), - 'section' => 'coletivo_hero_options', - ) - ); - - /*------------------------------------------------------------------------*/ - /* Section: Hero - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_hero_panel' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_hero_panel' ), - 'title' => esc_html__( 'Section: Hero', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - // Hero settings - $wp_customize->add_section( 'coletivo_hero_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Hero Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_hero_panel', - ) - ); - // Show section - $wp_customize->add_setting( 'coletivo_hero_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_hero_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_hero_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - - // Title - $wp_customize->add_setting( 'coletivo_hero_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_hero_title', - array( - 'label' => esc_html__('Title section in customizer', 'coletivo'), - 'section' => 'coletivo_hero_settings', - 'description' => esc_html__( 'This title is only showed in customizer', 'coletivo'), - ) - ); - - - // Section ID - $wp_customize->add_setting( 'coletivo_hero_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('hero', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_hero_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_hero_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ) - ) - ); - // Show hero full screen - $wp_customize->add_setting( 'coletivo_hero_fullscreen', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_hero_fullscreen', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Make hero section full screen', 'coletivo'), - 'section' => 'coletivo_hero_settings', - 'description' => esc_html__('Check this box to make hero section full screen.', 'coletivo'), - ) - ); - // Hero content padding top - $wp_customize->add_setting( 'coletivo_hero_pdtop', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('10', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_hero_pdtop', - array( - 'label' => esc_html__('Padding Top:', 'coletivo'), - 'section' => 'coletivo_hero_settings', - 'description' => esc_html__( 'The hero content padding top in percent (%).', 'coletivo' ), - 'active_callback' => 'coletivo_hero_fullscreen_callback' - ) - ); - // Hero content padding bottom - $wp_customize->add_setting( 'coletivo_hero_pdbotom', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('10', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_hero_pdbotom', - array( - 'label' => esc_html__('Padding Bottom:', 'coletivo'), - 'section' => 'coletivo_hero_settings', - 'description' => esc_html__( 'The hero content padding bottom in percent (%).', 'coletivo' ), - 'active_callback' => 'coletivo_hero_fullscreen_callback' - ) - ); - $wp_customize->add_section( 'coletivo_hero_images' , - array( - 'priority' => 6, - 'title' => esc_html__( 'Hero Background Media', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_hero_panel', - ) - ); - $wp_customize->add_setting( 'coletivo_hero_images', - array( - 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', - 'transport' => 'refresh', // refresh or postMessage - 'default' => json_encode( array( - array( - 'image'=> array( - 'url' => get_template_directory_uri().'/assets/images/coletivo1.jpg', - 'id' => '' - ) - ) - ) ) - ) ); - $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( - $wp_customize, - 'coletivo_hero_images', - array( - 'label' => esc_html__('Background Images', 'coletivo'), - 'description' => '', - 'priority' => 40, - 'section' => 'coletivo_hero_images', - 'title_format' => esc_html__( 'Background', 'coletivo'), // [live_title] - 'max_item' => 5, // Maximum item can add - 'fields' => array( - 'image' => array( - 'title' => esc_html__('Background Image', 'coletivo'), - 'type' =>'media', - 'default' => array( - 'url' => get_template_directory_uri().'/assets/images/coletivo1.jpg', - 'id' => '' - ) - ), - ), - ) - ) - ); - // Overlay color - $wp_customize->add_setting( 'coletivo_hero_overlay_color', - array( - 'sanitize_callback' => 'coletivo_sanitize_color_alpha', - 'default' => 'rgba(0,0,0,.3)', - 'transport' => 'refresh', // refresh or postMessage - ) - ); - $wp_customize->add_control( new coletivo_Alpha_Color_Control( - $wp_customize, - 'coletivo_hero_overlay_color', - array( - 'label' => esc_html__('Background Overlay Color', 'coletivo'), - 'section' => 'coletivo_hero_images', - 'priority' => 130, - ) - ) - ); - // Parallax - $wp_customize->add_setting( 'coletivo_hero_parallax', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => 0, - 'transport' => 'refresh', // refresh or postMessage - ) - ); - $wp_customize->add_control( 'coletivo_hero_parallax', - array( - 'label' => esc_html__('Enable parallax effect (apply for first BG image only)', 'coletivo'), - 'section' => 'coletivo_hero_images', - 'type' => 'checkbox', - 'priority' => 50, - 'description' => '', - ) - ); - $wp_customize->add_section( 'coletivo_hero_content_layout1' , - array( - 'priority' => 9, - 'title' => esc_html__( 'Hero Content Layout', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_hero_panel', - ) - ); - // Hero Layout - $wp_customize->add_setting( 'coletivo_hero_layout', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '1', - ) - ); - $wp_customize->add_control( 'coletivo_hero_layout', - array( - 'label' => esc_html__('Display Layout', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1', - 'description' => '', - 'type' => 'select', - 'choices' => array( - '1' => esc_html__('Layout 1', 'coletivo' ), - '2' => esc_html__('Layout 2', 'coletivo' ), - ), - ) - ); - // For Hero layout ------------------------ - // Large Text - $wp_customize->add_setting( 'coletivo_hcl1_largetext', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'mod' => 'html', - 'default' => __('We are coletivo | One Page | Responsive | Perfection', 'coletivo'), - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_hcl1_largetext', - array( - 'label' => esc_html__('Large Text', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1', - 'description' => esc_html__('Text Rotating Guide: Put your rotate texts separate by "|" into ..., go to Customizer->Site Option->Animate to control rotate animation.', 'coletivo'), - ) - )); - // Small Text - $wp_customize->add_setting( 'coletivo_hcl1_smalltext', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => __('Morbi tempus porta nunc pharetra quisque ligula imperdiet posuere
    vitae felis proin sagittis leo ac tellus blandit sollicitudin quisque vitae placerat.', 'coletivo'), - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_hcl1_smalltext', - array( - 'label' => esc_html__('Small Text', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1', - 'mod' => 'html', - 'description' => esc_html__('You can use text rotate slider in this textarea too.', 'coletivo'), - ) - )); - // Button #1 Text - $wp_customize->add_setting( 'coletivo_hcl1_btn1_text', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('About Us', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_hcl1_btn1_text', - array( - 'label' => esc_html__('Button #1 Text', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1' - ) - ); - // Button #1 Link - $wp_customize->add_setting( 'coletivo_hcl1_btn1_link', - array( - 'sanitize_callback' => 'esc_url', - 'default' => esc_url( home_url( '/' )).esc_html__('#about', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_hcl1_btn1_link', - array( - 'label' => esc_html__('Button #1 Link', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1' - ) - ); - // Button #1 Style - $wp_customize->add_setting( 'coletivo_hcl1_btn1_style', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => 'btn-theme-primary', - ) - ); - $wp_customize->add_control( 'coletivo_hcl1_btn1_style', - array( - 'label' => esc_html__('Button #1 style', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1', - 'type' => 'select', - 'choices' => array( - 'btn-theme-primary' => esc_html__('Button Primary', 'coletivo'), - 'btn-secondary-outline' => esc_html__('Button Secondary', 'coletivo'), - 'btn-default' => esc_html__('Button', 'coletivo'), - 'btn-primary' => esc_html__('Primary', 'coletivo'), - 'btn-success' => esc_html__('Success', 'coletivo'), - 'btn-info' => esc_html__('Info', 'coletivo'), - 'btn-warning' => esc_html__('Warning', 'coletivo'), - 'btn-danger' => esc_html__('Danger', 'coletivo'), - ) - ) - ); - // Button #2 Text - $wp_customize->add_setting( 'coletivo_hcl1_btn2_text', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('Get Started', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_hcl1_btn2_text', - array( - 'label' => esc_html__('Button #2 Text', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1' - ) - ); - // Button #2 Link - $wp_customize->add_setting( 'coletivo_hcl1_btn2_link', - array( - 'sanitize_callback' => 'esc_url', - 'default' => esc_url( home_url( '/' )).esc_html__('#contact', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_hcl1_btn2_link', - array( - 'label' => esc_html__('Button #2 Link', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1' - ) - ); - // Button #1 Style - $wp_customize->add_setting( 'coletivo_hcl1_btn2_style', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => 'btn-secondary-outline', - ) - ); - $wp_customize->add_control( 'coletivo_hcl1_btn2_style', - array( - 'label' => esc_html__('Button #1 style', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1', - 'type' => 'select', - 'choices' => array( - 'btn-theme-primary' => esc_html__('Button Primary', 'coletivo'), - 'btn-secondary-outline' => esc_html__('Button Secondary', 'coletivo'), - 'btn-default' => esc_html__('Button', 'coletivo'), - 'btn-primary' => esc_html__('Primary', 'coletivo'), - 'btn-success' => esc_html__('Success', 'coletivo'), - 'btn-info' => esc_html__('Info', 'coletivo'), - 'btn-warning' => esc_html__('Warning', 'coletivo'), - 'btn-danger' => esc_html__('Danger', 'coletivo'), - ) - ) - ); - /* Layout 2 ---- */ - // Layout 22 content text - $wp_customize->add_setting( 'coletivo_hcl2_content', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'mod' => 'html', - 'default' => wp_kses_post( '

    Business Website'."\n".'Made Simple.

    '."\n".'We provide creative solutions to clients around the world,'."\n".'creating things that get attention and meaningful.'."\n\n".'Get Started' ), - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_hcl2_content', - array( - 'label' => esc_html__('Content Text', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1', - 'description' => '', - ) - )); - // Layout 2 image - $wp_customize->add_setting( 'coletivo_hcl2_image', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'mod' => 'html', - 'default' => get_template_directory_uri().'/assets/images/coletivo_responsive.png', - ) - ); - $wp_customize->add_control( new WP_Customize_Image_Control( - $wp_customize, - 'coletivo_hcl2_image', - array( - 'label' => esc_html__('Image', 'coletivo'), - 'section' => 'coletivo_hero_content_layout1', - 'description' => '', - ) - )); - /*------------------------------------------------------------------------*/ - /* End of Section Hero - /*------------------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - /* Section: Features - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_features' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_features' ), - 'title' => esc_html__( 'Section: Features', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_section( 'coletivo_features_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_features', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_features_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_features_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_features_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Section ID - $wp_customize->add_setting( 'coletivo_features_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('features', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_features_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_features_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ) - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_features_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Features', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_features_title', - array( - 'label' => esc_html__('Section Title', 'coletivo'), - 'section' => 'coletivo_features_settings', - 'description' => '', - ) - ); - // Sub Title - $wp_customize->add_setting( 'coletivo_features_subtitle', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Section subtitle', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_features_subtitle', - array( - 'label' => esc_html__('Section Subtitle', 'coletivo'), - 'section' => 'coletivo_features_settings', - 'description' => '', - ) - ); - // Description - $wp_customize->add_setting( 'coletivo_features_desc', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_features_desc', - array( - 'label' => esc_html__('Section Description', 'coletivo'), - 'section' => 'coletivo_features_settings', - 'description' => '', - ) - )); - // Features layout - $wp_customize->add_setting( 'coletivo_features_layout', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => '3', - ) - ); - $wp_customize->add_control( 'coletivo_features_layout', - array( - 'label' => esc_html__('Features Layout Setting', 'coletivo'), - 'section' => 'coletivo_features_settings', - 'description' => '', - 'type' => 'select', - 'choices' => array( - '3' => esc_html__( '4 Columns', 'coletivo' ), - '4' => esc_html__( '3 Columns', 'coletivo' ), - '6' => esc_html__( '2 Columns', 'coletivo' ), - ), - ) - ); - $wp_customize->add_section( 'coletivo_features_content' , - array( - 'priority' => 6, - 'title' => esc_html__( 'Section Content', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_features', - ) - ); - // Order & Styling - $wp_customize->add_setting( - 'coletivo_features_boxes', - array( - //'default' => '', - 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', - 'transport' => 'refresh', // refresh or postMessage - ) ); - $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( - $wp_customize, - 'coletivo_features_boxes', - array( - 'label' => esc_html__('Features content', 'coletivo'), - 'description' => '', - 'section' => 'coletivo_features_content', - 'live_title_id' => 'title', // apply for unput text and textarea only - 'title_format' => esc_html__('[live_title]', 'coletivo'), // [live_title] - 'max_item' => 12, // Maximum item can add - 'limited_msg' => esc_html__( 'Only 12 features allowed', 'coletivo' ), - 'fields' => array( - 'title' => array( - 'title' => esc_html__('Title', 'coletivo'), - 'type' =>'text', - ), - 'icon_type' => array( - 'title' => esc_html__('Custom icon', 'coletivo'), - 'type' =>'select', - 'options' => array( - 'icon' => esc_html__('Icon', 'coletivo'), - 'image' => esc_html__('image', 'coletivo'), - ), - ), - 'icon' => array( - 'title' => esc_html__('Icon', 'coletivo'), - 'type' =>'icon', - 'required' => array( 'icon_type', '=', 'icon' ), - ), - 'image' => array( - 'title' => esc_html__('Image', 'coletivo'), - 'type' =>'media', - 'required' => array( 'icon_type', '=', 'image' ), - ), - 'desc' => array( - 'title' => esc_html__('Description', 'coletivo'), - 'type' =>'editor', - ), - 'link' => array( - 'title' => esc_html__('Custom Link', 'coletivo'), - 'type' =>'text', - ), - ), - ) - ) - ); - /*------------------------------------------------------------------------*/ - /* End of Section Features - /*------------------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - /* Section: Your Slider - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_yourslider' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_yourslider' ), - 'title' => esc_html__( 'Section: Your Slider', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_section( 'coletivo_yourslider_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_yourslider', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_yourslider_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_yourslider_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_yourslider_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Section ID - $wp_customize->add_setting( 'coletivo_yourslider_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('yourslider', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_yourslider_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_yourslider_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ) - ) - ); - $wp_customize->add_section( 'coletivo_yourslider_content' , - array( - 'priority' => 6, - 'title' => esc_html__( 'Section Content', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_yourslider', - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_yourslider_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Your Slider', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_yourslider_title', - array( - 'label' => esc_html__('Section Title', 'coletivo'), - 'section' => 'coletivo_yourslider_content', - 'description' => '', - ) - ); - // Sub Title - $wp_customize->add_setting( 'coletivo_yourslider_subtitle', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('See all we Do', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_yourslider_subtitle', - array( - 'label' => esc_html__('Section Subtitle', 'coletivo'), - 'section' => 'coletivo_yourslider_content', - 'description' => '', - ) - ); - // Description - $wp_customize->add_setting( 'coletivo_yourslider_shortcode', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_yourslider_shortcode', - array( - 'label' => esc_html__('Slider Shortcode', 'coletivo'), - 'section' => 'coletivo_yourslider_content', - 'description' => __( 'In order to display a Slider install the plugin of your preference and then copy the shortcode and paste it here, the shortcode will be like this [metaslider id=XXX] or this [brasa_slider id="123"]', 'coletivo' ) - ) - ); - - /*------------------------------------------------------------------------*/ - /* End of Section Your Slider - /*------------------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - /* Section: Featured Page - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_featuredpage' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_featuredpage' ), - 'title' => esc_html__( 'Section: Page Featured', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_section( 'coletivo_featuredpage_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_featuredpage', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_featuredpage_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_featuredpage_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_featuredpage_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_featuredpage_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_featuredpage_title', - array( - 'label' => esc_html__('Title section in customizer', 'coletivo'), - 'section' => 'coletivo_featuredpage_settings', - 'description' => esc_html__( 'This title is only showed in customizer', 'coletivo'), - ) - ); - - // Section ID - $wp_customize->add_setting( 'coletivo_featuredpage_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('featuredpage', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_featuredpage_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_featuredpage_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ) - ) - ); - $wp_customize->add_section( 'coletivo_featuredpage_content' , - array( - 'priority' => 6, - 'title' => esc_html__( 'Section Content', 'coletivo' ), - 'panel' => 'coletivo_featuredpage', - ) - ); - // Select Page - $wp_customize->add_setting('coletivo_featuredpage_content', - array( - 'default' => '', - 'sanitize_callback' => 'sanitize_text_field', - ) ); - $wp_customize->add_control( 'coletivo_featuredpage_content', - array( - 'label' => esc_html__('Featured Page', 'coletivo'), - 'section' => 'coletivo_featuredpage_content', - 'description' => esc_html__( 'You need to select a Featured Image for a background in full size.', 'coletivo' ), - 'type' => 'select', - 'choices' => $option_pages, - 'fields' => array( - 'options' => $option_pages - ) - ) ); - // Featured page content source - $wp_customize->add_setting( 'coletivo_featuredpage_content_source', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => 'content', - ) - ); - $wp_customize->add_control( 'coletivo_featuredpage_content_source', - array( - 'label' => esc_html__('Content source', 'coletivo'), - 'section' => 'coletivo_featuredpage_content', - 'type' => 'select', - 'choices' => array( - 'content' => esc_html__( 'Full Page Content', 'coletivo' ), - 'excerpt' => esc_html__( 'Page Excerpt', 'coletivo' ), - ), - ) - ); - // More Button - $wp_customize->add_setting( 'coletivo_featuredpage_more_text', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Discover', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_featuredpage_more_text', - array( - 'label' => esc_html__('Featured Page Button Text', 'coletivo'), - 'section' => 'coletivo_featuredpage_content', - 'description' => '', - ) - ); - - // Overlay color - $wp_customize->add_setting( 'coletivo_featuredpage_overlay_color', - array( - 'sanitize_callback' => 'coletivo_sanitize_color_alpha', - 'default' => 'rgba(0,0,0,.3)', - 'transport' => 'refresh', // refresh or postMessage - ) - ); - $wp_customize->add_control( new coletivo_Alpha_Color_Control( - $wp_customize, - 'coletivo_featuredpage_overlay_color', - array( - 'label' => esc_html__('Background Overlay Color', 'coletivo'), - 'section' => 'coletivo_featuredpage_content', - 'priority' => 30, - ) - ) - ); - /*------------------------------------------------------------------------*/ - /* End of Section Featured Page - /*------------------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - /* Section: Services - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_services' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_services' ), - 'title' => esc_html__( 'Section: Services', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_section( 'coletivo_service_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_services', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_services_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_services_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_service_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Section ID - $wp_customize->add_setting( 'coletivo_services_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('services', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_services_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_service_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.' , 'coletivo') - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_services_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Our Services', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_services_title', - array( - 'label' => esc_html__('Section Title', 'coletivo'), - 'section' => 'coletivo_service_settings', - 'description' => '', - ) - ); - // Sub Title - $wp_customize->add_setting( 'coletivo_services_subtitle', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Section subtitle', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_services_subtitle', - array( - 'label' => esc_html__('Section Subtitle', 'coletivo'), - 'section' => 'coletivo_service_settings', - 'description' => '', - ) - ); - // Description - $wp_customize->add_setting( 'coletivo_services_desc', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_services_desc', - array( - 'label' => esc_html__('Section Description', 'coletivo'), - 'section' => 'coletivo_service_settings', - 'description' => '', - ) - )); - // Services layout - $wp_customize->add_setting( 'coletivo_service_layout', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => '6', - ) - ); - $wp_customize->add_control( 'coletivo_service_layout', - array( - 'label' => esc_html__('Services Layout Setting', 'coletivo'), - 'section' => 'coletivo_service_settings', - 'description' => '', - 'type' => 'select', - 'choices' => array( - '3' => esc_html__( '4 Columns', 'coletivo' ), - '4' => esc_html__( '3 Columns', 'coletivo' ), - '6' => esc_html__( '2 Columns', 'coletivo' ), - ), - ) - ); - $wp_customize->add_section( 'coletivo_service_content' , - array( - 'priority' => 6, - 'title' => esc_html__( 'Section Content', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_services', - ) - ); - // Section service content. - $wp_customize->add_setting( - 'coletivo_services', - array( - 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', - 'transport' => 'refresh', // refresh or postMessage - ) ); - $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( - $wp_customize, - 'coletivo_services', - array( - 'label' => esc_html__('Service content', 'coletivo'), - 'description' => '', - 'section' => 'coletivo_service_content', - 'live_title_id' => 'content_page', // apply for unput text and textarea only - 'title_format' => esc_html__('[live_title]', 'coletivo'), // [live_title] - 'max_item' => 12, // Maximum item can add - 'limited_msg' => esc_html__( 'Only 12 Services highlights allowed ', 'coletivo' ), - 'fields' => array( - 'icon_type' => array( - 'title' => esc_html__('Custom icon', 'coletivo'), - 'type' =>'select', - 'options' => array( - 'icon' => esc_html__('Icon', 'coletivo'), - 'image' => esc_html__('image', 'coletivo'), - ), - ), - 'icon' => array( - 'title' => esc_html__('Icon', 'coletivo'), - 'type' =>'icon', - 'required' => array( 'icon_type', '=', 'icon' ), - ), - 'image' => array( - 'title' => esc_html__('Image', 'coletivo'), - 'type' =>'media', - 'required' => array( 'icon_type', '=', 'image' ), - ), - 'content_page' => array( - 'title' => esc_html__('Select a page', 'coletivo'), - 'type' =>'select', - 'options' => $option_pages - ), - 'enable_link' => array( - 'title' => esc_html__('Link to single page', 'coletivo'), - 'type' =>'checkbox', - ), - ), - ) - ) - ); - /*------------------------------------------------------------------------*/ - /* End of Section Services - /*------------------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - /* Section: Portfolio - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_portfolio' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_portfolio' ), - 'title' => esc_html__( 'Section: Portfolio', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_is_jetpack_active' - ) - ); - $wp_customize->add_section( 'coletivo_portfolio_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_portfolio', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_portfolio_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_portfolio_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_portfolio_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Section ID - $wp_customize->add_setting( 'coletivo_portfolio_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('portfolio', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_portfolio_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_portfolio_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ) - ) - ); - // Number of projects to show. - $wp_customize->add_setting( 'coletivo_portfolio_number', - array( - 'sanitize_callback' => 'coletivo_sanitize_number', - 'default' => '3', - ) - ); - $wp_customize->add_control( 'coletivo_portfolio_number', - array( - 'label' => esc_html__('Number of projects to show', 'coletivo'), - 'section' => 'coletivo_portfolio_settings', - 'description' => '', - ) - ); - $wp_customize->add_section( 'coletivo_portfolio_content' , - array( - 'priority' => 6, - 'title' => esc_html__( 'Section Content', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_portfolio', - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_portfolio_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Our Work', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_portfolio_title', - array( - 'label' => esc_html__('Section Title', 'coletivo'), - 'section' => 'coletivo_portfolio_content', - 'description' => '', - ) - ); - // Sub Title - $wp_customize->add_setting( 'coletivo_portfolio_subtitle', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Section subtitle', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_portfolio_subtitle', - array( - 'label' => esc_html__('Section Subtitle', 'coletivo'), - 'section' => 'coletivo_portfolio_content', - 'description' => '', - ) - ); - // Description - $wp_customize->add_setting( 'coletivo_portfolio_desc', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_portfolio_desc', - array( - 'label' => esc_html__('Section Description', 'coletivo'), - 'section' => 'coletivo_portfolio_content', - 'description' => '', - ) - )); - // Portfolio Button - $wp_customize->add_setting( 'coletivo_portfolio_more_link', - array( - 'sanitize_callback' => 'esc_url', - 'default' => '#', - ) - ); - $wp_customize->add_control( 'coletivo_portfolio_more_link', - array( - 'label' => esc_html__('Portfolio Button Link', 'coletivo'), - 'section' => 'coletivo_portfolio_content', - 'description' => esc_html__('It should be your portfolio page link.', 'coletivo' ) - ) - ); - $wp_customize->add_setting( 'coletivo_portfolio_more_text', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('See Our Portfolio', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_portfolio_more_text', - array( - 'label' => esc_html__('Portfolio Button Text', 'coletivo'), - 'section' => 'coletivo_portfolio_content', - 'description' => '', - ) - ); - /*------------------------------------------------------------------------*/ - /* End of Section Portfolio - /*------------------------------------------------------------------------*/ - // jetpack section - - /*------------------------------------------------------------------------*/ - /* Section: Video Lightbox - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_videolightbox' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_videolightbox' ), - 'title' => esc_html__( 'Section: Video Lightbox', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_section( 'coletivo_videolightbox_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_videolightbox', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_videolightbox_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_videolightbox_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_videolightbox_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_videolightbox_section_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_videolightbox_section_title', - array( - 'label' => esc_html__('Title section in customizer', 'coletivo'), - 'section' => 'coletivo_videolightbox_settings', - 'description' => esc_html__( 'This title is only showed in customizer', 'coletivo'), - ) - ); - // Section ID - $wp_customize->add_setting( 'coletivo_videolightbox_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => 'videolightbox', - ) - ); - $wp_customize->add_control( 'coletivo_videolightbox_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_videolightbox_settings', - 'description' => esc_html__('The section id, we will use this for link anchor.', 'coletivo' ) - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_videolightbox_title', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_videolightbox_title', - array( - 'label' => esc_html__('Section heading', 'coletivo'), - 'section' => 'coletivo_videolightbox_settings', - 'description' => '', - ) - )); - // Video URL - $wp_customize->add_setting( 'coletivo_videolightbox_url', - array( - 'sanitize_callback' => 'esc_url_raw', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_videolightbox_url', - array( - 'label' => esc_html__('Video url', 'coletivo'), - 'section' => 'coletivo_videolightbox_settings', - 'description' => esc_html__('Paste Youtube or Vimeo url here', 'coletivo'), - ) - ); - // Parallax image - $wp_customize->add_setting( 'coletivo_videolightbox_image', - array( - 'sanitize_callback' => 'esc_url_raw', - 'default' => '', - ) - ); - $wp_customize->add_control( new WP_Customize_Image_Control( - $wp_customize, - 'coletivo_videolightbox_image', - array( - 'label' => esc_html__('Background image', 'coletivo'), - 'section' => 'coletivo_videolightbox_settings', - ) - )); - /*------------------------------------------------------------------------*/ - /* Section: Gallery - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_gallery' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_gallery' ), - 'title' => esc_html__( 'Section: Gallery', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_section( 'coletivo_gallery_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_gallery', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_gallery_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => 1, - ) - ); - $wp_customize->add_control( 'coletivo_gallery_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_gallery_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Section ID - $wp_customize->add_setting( 'coletivo_gallery_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('gallery', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_gallery_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_gallery_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ) - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_gallery_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Gallery', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_gallery_title', - array( - 'label' => esc_html__('Section Title', 'coletivo'), - 'section' => 'coletivo_gallery_settings', - 'description' => '', - ) - ); - // Sub Title - $wp_customize->add_setting( 'coletivo_gallery_subtitle', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Section subtitle', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_gallery_subtitle', - array( - 'label' => esc_html__('Section Subtitle', 'coletivo'), - 'section' => 'coletivo_gallery_settings', - 'description' => '', - ) - ); - // Description - $wp_customize->add_setting( 'coletivo_gallery_desc', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_gallery_desc', - array( - 'label' => esc_html__('Section Description', 'coletivo'), - 'section' => 'coletivo_gallery_settings', - 'description' => '', - ) - )); - $wp_customize->add_section( 'coletivo_gallery_content' , - array( - 'priority' => 6, - 'title' => esc_html__( 'Section Content', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_gallery', - ) - ); - // Source page settings - $wp_customize->add_setting( 'coletivo_gallery_source_page', - array( - 'sanitize_callback' => 'coletivo_sanitize_number', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_gallery_source_page', - array( - 'label' => esc_html__('Select Gallery Page', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'type' => 'select', - 'priority' => 10, - 'choices' => $option_pages, - 'description' => esc_html__('Select a page which have content contain [gallery] shortcode.', 'coletivo'), - ) - ); - // Gallery Layout - $wp_customize->add_setting( 'coletivo_gallery_layout', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => 'default', - ) - ); - $wp_customize->add_control( 'coletivo_gallery_layout', - array( - 'label' => esc_html__('Layout', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'type' => 'select', - 'priority' => 40, - 'choices' => array( - 'default' => esc_html__('Default, inside container', 'coletivo'), - 'full-width' => esc_html__('Full Width', 'coletivo'), - ) - ) - ); - // Gallery Display - $wp_customize->add_setting( 'coletivo_gallery_display', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => 'default', - ) - ); - $wp_customize->add_control( 'coletivo_gallery_display', - array( - 'label' => esc_html__('Display', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'type' => 'select', - 'priority' => 50, - 'choices' => array( - 'grid' => esc_html__('Grid', 'coletivo'), - 'carousel' => esc_html__('Carousel', 'coletivo'), - 'slider' => esc_html__('Slider', 'coletivo'), - 'justified' => esc_html__('Justified', 'coletivo'), - ) - ) - ); - // Gallery grid spacing - $wp_customize->add_setting( 'coletivo_g_spacing', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => 20, - ) - ); - $wp_customize->add_control( 'coletivo_g_spacing', - array( - 'label' => esc_html__('Item Spacing', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'priority' => 55, - ) - ); - // Gallery grid spacing - $wp_customize->add_setting( 'coletivo_g_row_height', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => 120, - ) - ); - $wp_customize->add_control( 'coletivo_g_row_height', - array( - 'label' => esc_html__('Row Height', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'priority' => 57, - ) - ); - // Gallery grid gird col - $wp_customize->add_setting( 'coletivo_g_col', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => '4', - ) - ); - $wp_customize->add_control( 'coletivo_g_col', - array( - 'label' => esc_html__('Layout columns', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'priority' => 60, - 'type' => 'select', - 'choices' => array( - '1' => 1, - '2' => 2, - '3' => 3, - '4' => 4, - '5' => 5, - '6' => 6, - ) - ) - ); - // Gallery max number - $wp_customize->add_setting( 'coletivo_g_number', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => 10, - ) - ); - $wp_customize->add_control( 'coletivo_g_number', - array( - 'label' => esc_html__('Number items', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'priority' => 65, - ) - ); - // Gallery grid spacing - $wp_customize->add_setting( 'coletivo_g_lightbox', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => 1, - ) - ); - $wp_customize->add_control( 'coletivo_g_lightbox', - array( - 'label' => esc_html__('Enable Lightbox', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'priority' => 70, - 'type' => 'checkbox', - ) - ); - // Gallery readmore link - $wp_customize->add_setting( 'coletivo_g_readmore_link', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_g_readmore_link', - array( - 'label' => esc_html__('Read More Link', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'priority' => 90, - 'type' => 'text', - ) - ); - $wp_customize->add_setting( 'coletivo_g_readmore_text', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('View More', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_g_readmore_text', - array( - 'label' => esc_html__('Read More Text', 'coletivo'), - 'section' => 'coletivo_gallery_content', - 'priority' => 100, - 'type' => 'text', - ) - ); - // jetpack section - /*------------------------------------------------------------------------*/ - /* End of Section Gallery - /*------------------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - /* Section: Team - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_team' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_team' ), - 'title' => esc_html__( 'Section: Team', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_section( 'coletivo_team_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_team', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_team_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_team_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_team_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Section ID - $wp_customize->add_setting( 'coletivo_team_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('team', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_team_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_team_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.' , 'coletivo') - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_team_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Our Team', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_team_title', - array( - 'label' => esc_html__('Section Title', 'coletivo'), - 'section' => 'coletivo_team_settings', - 'description' => '', - ) - ); - // Sub Title - $wp_customize->add_setting( 'coletivo_team_subtitle', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Section subtitle', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_team_subtitle', - array( - 'label' => esc_html__('Section Subtitle', 'coletivo'), - 'section' => 'coletivo_team_settings', - 'description' => '', - ) - ); - // Description - $wp_customize->add_setting( 'coletivo_team_desc', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_team_desc', - array( - 'label' => esc_html__('Section Description', 'coletivo'), - 'section' => 'coletivo_team_settings', - 'description' => '', - ) - )); - // Team layout - $wp_customize->add_setting( 'coletivo_team_layout', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => '3', - ) - ); - $wp_customize->add_control( 'coletivo_team_layout', - array( - 'label' => esc_html__('Team Layout Setting', 'coletivo'), - 'section' => 'coletivo_team_settings', - 'description' => '', - 'type' => 'select', - 'choices' => array( - '3' => esc_html__( '4 Columns', 'coletivo' ), - '4' => esc_html__( '3 Columns', 'coletivo' ), - '6' => esc_html__( '2 Columns', 'coletivo' ), - ), - ) - ); - $wp_customize->add_section( 'coletivo_team_content' , - array( - 'priority' => 6, - 'title' => esc_html__( 'Section Content', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_team', - ) - ); - // Team member settings - $wp_customize->add_setting( - 'coletivo_team_members', - array( - 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', - 'transport' => 'refresh', // refresh or postMessage - ) ); - $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( - $wp_customize, - 'coletivo_team_members', - array( - 'label' => esc_html__('Team members', 'coletivo'), - 'description' => '', - 'section' => 'coletivo_team_content', - //'live_title_id' => 'user_id', // apply for unput text and textarea only - 'title_format' => esc_html__( '[live_title]', 'coletivo'), // [live_title] - 'max_item' => 12, // Maximum item can add - 'limited_msg' => esc_html__( 'Only 12 members allowed', 'coletivo' ), - 'fields' => array( - 'user_id' => array( - 'title' => esc_html__('User media', 'coletivo'), - 'type' =>'media', - 'desc' => '', - ), - 'link' => array( - 'title' => esc_html__('Custom Link', 'coletivo'), - 'type' =>'text', - 'desc' => '', - ), - ), - ) - ) - ); - /*------------------------------------------------------------------------*/ - /* Section: News - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_news' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_news' ), - 'title' => esc_html__( 'Section: News', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_section( 'coletivo_news_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_news', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_news_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_news_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_news_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Section ID - $wp_customize->add_setting( 'coletivo_news_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('news', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_news_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_news_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ) - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_news_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Latest News', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_news_title', - array( - 'label' => esc_html__('Section Title', 'coletivo'), - 'section' => 'coletivo_news_settings', - 'description' => '', - ) - ); - // Sub Title - $wp_customize->add_setting( 'coletivo_news_subtitle', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Section subtitle', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_news_subtitle', - array( - 'label' => esc_html__('Section Subtitle', 'coletivo'), - 'section' => 'coletivo_news_settings', - 'description' => '', - ) - ); - // Description - $wp_customize->add_setting( 'coletivo_news_desc', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_news_desc', - array( - 'label' => esc_html__('Section Description', 'coletivo'), - 'section' => 'coletivo_news_settings', - 'description' => '', - ) - )); - // hr - $wp_customize->add_setting( 'coletivo_news_settings_hr', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - ) - ); - $wp_customize->add_control( new coletivo_Misc_Control( $wp_customize, 'coletivo_news_settings_hr', - array( - 'section' => 'coletivo_news_settings', - 'type' => 'hr' - ) - )); - // Number of post to show. - $wp_customize->add_setting( 'coletivo_news_number', - array( - 'sanitize_callback' => 'coletivo_sanitize_number', - 'default' => '3', - ) - ); - $wp_customize->add_control( 'coletivo_news_number', - array( - 'label' => esc_html__('Number of post to show', 'coletivo'), - 'section' => 'coletivo_news_settings', - 'description' => '', - ) - ); - // Blog Button - $wp_customize->add_setting( 'coletivo_news_more_link', - array( - 'sanitize_callback' => 'esc_url', - 'default' => '#', - ) - ); - $wp_customize->add_control( 'coletivo_news_more_link', - array( - 'label' => esc_html__('More News button link', 'coletivo'), - 'section' => 'coletivo_news_settings', - 'description' => esc_html__( 'It should be your blog page link.', 'coletivo' ) - ) - ); - $wp_customize->add_setting( 'coletivo_news_more_text', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Read Our Blog', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_news_more_text', - array( - 'label' => esc_html__('More News Button Text', 'coletivo'), - 'section' => 'coletivo_news_settings', - 'description' => '', - ) - ); - /*------------------------------------------------------------------------*/ - /* Section: Contact - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_contact' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_contact' ), - 'title' => esc_html__( 'Section: Contact', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - $wp_customize->add_section( 'coletivo_contact_settings' , - array( - 'priority' => 3, - 'title' => esc_html__( 'Section Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_contact', - ) - ); - // Show Content - $wp_customize->add_setting( 'coletivo_contact_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide this section?', 'coletivo'), - 'section' => 'coletivo_contact_settings', - 'description' => esc_html__('Check this box to hide this section.', 'coletivo'), - ) - ); - // Show Form - $wp_customize->add_setting( 'coletivo_contact_cf7_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_cf7_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide contact form completely.', 'coletivo'), - 'section' => 'coletivo_contact_settings', - 'description' => esc_html__('Check this box to hide contact form.', 'coletivo'), - ) - ); - // Section ID - $wp_customize->add_setting( 'coletivo_contact_id', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => esc_html__('contact', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_contact_id', - array( - 'label' => esc_html__('Section ID:', 'coletivo'), - 'section' => 'coletivo_contact_settings', - 'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' ) - ) - ); - // Title - $wp_customize->add_setting( 'coletivo_contact_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Get in touch', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_contact_title', - array( - 'label' => esc_html__('Section Title', 'coletivo'), - 'section' => 'coletivo_contact_settings', - 'description' => '', - ) - ); - // Sub Title - $wp_customize->add_setting( 'coletivo_contact_subtitle', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__('Section subtitle', 'coletivo'), - ) - ); - $wp_customize->add_control( 'coletivo_contact_subtitle', - array( - 'label' => esc_html__('Section Subtitle', 'coletivo'), - 'section' => 'coletivo_contact_settings', - 'description' => '', - ) - ); - // Description - $wp_customize->add_setting( 'coletivo_contact_desc', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_contact_desc', - array( - 'label' => esc_html__('Section Description', 'coletivo'), - 'section' => 'coletivo_contact_settings', - 'description' => '', - ) - )); - $wp_customize->add_section( 'coletivo_contact_content' , - array( - 'priority' => 6, - 'title' => esc_html__( 'Section Content', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_contact', - ) - ); - // Contact form guide. - $wp_customize->add_setting( 'coletivo_contact_cf7_guide', - array( - 'sanitize_callback' => 'coletivo_sanitize_text' - ) - ); - $wp_customize->add_control( new coletivo_Misc_Control( $wp_customize, 'coletivo_contact_cf7_guide', - array( - 'section' => 'coletivo_contact_content', - 'type' => 'custom_message', - 'description' => __( 'In order to display a contact form install a plugin and then copy the shortcode and paste it here, the shortcode will be like this [contact-form][contact-field...][/contact-form]', 'coletivo' ) - ) - )); - // Contact Form Shortcode - $wp_customize->add_setting( 'coletivo_contact_cf7', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_cf7', - array( - 'label' => esc_html__('Contact Form Shortcode', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => '', - ) - ); +defined( 'ABSPATH' ) || exit; - // hr - $wp_customize->add_setting( 'coletivo_contact_text_hr', array( 'sanitize_callback' => 'coletivo_sanitize_text' ) ); - $wp_customize->add_control( new coletivo_Misc_Control( $wp_customize, 'coletivo_contact_text_hr', - array( - 'section' => 'coletivo_contact_content', - 'type' => 'hr' - ) - )); - // Contact Text +/** + * Add postMessage support for site title and description for the Theme Customizer. + * + * @param WP_Customize_Manager $wp_customize Theme Customizer object. + */ +function coletivo_customize_register( $wp_customize ) { - $wp_customize->add_setting( 'coletivo_contact_address_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_address_title', - array( - 'label' => esc_html__('Contact Box Title', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => '', - ) - ); - $wp_customize->add_setting( 'coletivo_contact_text', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( new coletivo_Editor_Custom_Control( - $wp_customize, - 'coletivo_contact_text', - array( - 'label' => esc_html__('Contact Text', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => '', - ) - )); - // Address Box - // Contact Address - $wp_customize->add_setting( 'coletivo_contact_address', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_address', - array( - 'label' => esc_html__('Address', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => '', - ) - ); - // Contact Phone - $wp_customize->add_setting( 'coletivo_contact_phone', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_phone', - array( - 'label' => esc_html__('Phone', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => '', - ) - ); - // Contact What's app - $wp_customize->add_setting( 'coletivo_contact_whats', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_whats', - array( - 'label' => esc_html__('What´s App', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => '', - ) - ); - // Contact Email - $wp_customize->add_setting( 'coletivo_contact_email', - array( - 'sanitize_callback' => 'sanitize_email', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_email', - array( - 'label' => esc_html__('Email', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => '', - ) - ); - // Contact Social Networks - $wp_customize->add_setting( 'coletivo_contact_fb', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_fb', - array( - 'label' => esc_html__('Facebook', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => esc_html__('Enter the name of the page url after the "/" (example of url https://www.facebook.com/facebook, just put facebook)', 'coletivo') - ) - ); - $wp_customize->add_setting( 'coletivo_contact_instagram', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_instagram', - array( - 'label' => esc_html__('Instagram', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => esc_html__('Enter your Instagram username', 'coletivo') - ) - ); - $wp_customize->add_setting( 'coletivo_contact_twitter', - array( - 'sanitize_callback' => 'coletivo_sanitize_text', - 'default' => '', - ) - ); - $wp_customize->add_control( 'coletivo_contact_twitter', - array( - 'label' => esc_html__('Twitter', 'coletivo'), - 'section' => 'coletivo_contact_content', - 'description' => esc_html__('Enter your Twitter username', 'coletivo') - ) - ); - /*------------------------------------------------------------------------*/ - /* End of Section Contact - /*------------------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - /* Section: Social - /*------------------------------------------------------------------------*/ - $wp_customize->add_panel( 'coletivo_social_panel' , - array( - 'priority' => coletivo_get_customizer_priority( 'coletivo_social_panel' ), - 'title' => esc_html__( 'Section: Social', 'coletivo' ), - 'description' => '', - 'active_callback' => 'coletivo_showon_frontpage' - ) - ); - // Social settings - $wp_customize->add_section( 'coletivo_social_settings' , - array( - 'priority' => 1, - 'title' => esc_html__( 'Social Settings', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_social_panel', - ) - ); - // Disable Social - $wp_customize->add_setting( 'coletivo_social_disable', - array( - 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => '1', - ) - ); - $wp_customize->add_control( 'coletivo_social_disable', - array( - 'type' => 'checkbox', - 'label' => esc_html__('Hide Footer Social?', 'coletivo'), - 'section' => 'coletivo_social_settings', - 'description' => esc_html__('Check this box to hide footer social section.', 'coletivo') - ) - ); - $wp_customize->add_setting( 'coletivo_social_footer_guide', - array( - 'sanitize_callback' => 'coletivo_sanitize_text' - ) - ); - $wp_customize->add_setting( 'coletivo_social_footer_title', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'default' => esc_html__( 'Keep Updated', 'coletivo' ), - 'transport' => 'postMessage', - ) - ); - // Social Title - $wp_customize->add_control( 'coletivo_social_footer_title', - array( - 'label' => esc_html__('Social Footer Title', 'coletivo'), - 'section' => 'coletivo_social_settings', - 'description' => '' - ) - ); - // Social BG color - $wp_customize->add_setting( 'coletivo_footer_bg', array( - 'sanitize_callback' => 'sanitize_hex_color_no_hash', - 'sanitize_js_callback' => 'maybe_hash_hex_color', - 'default' => '#939393', - 'transport' => 'postMessage' - ) ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'coletivo_footer_bg', - array( - 'label' => esc_html__( 'Footer Background', 'coletivo' ), - 'section' => 'coletivo_social_settings', - 'description' => '', - ) - )); - $wp_customize->add_section( 'coletivo_social' , - array( - 'priority' => 2, - 'title' => esc_html__( 'Social Profiles', 'coletivo' ), - 'description' => '', - 'panel' => 'coletivo_social_panel', - ) - ); - // Custom Message - $wp_customize->add_control( new coletivo_Misc_Control( $wp_customize, 'coletivo_social_footer_guide', - array( - 'section' => 'coletivo_social', - 'type' => 'custom_message', - 'description' => esc_html__( 'These social profiles setting below will display at the footer of your site.', 'coletivo' ) - ) - )); - // Social Profiles - $wp_customize->add_setting( - 'coletivo_social_profiles', - array( - //'default' => '', - 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', - 'transport' => 'postMessage', // refresh or postMessage - ) ); - $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( - $wp_customize, - 'coletivo_social_profiles', - array( - 'label' => esc_html__('Socials', 'coletivo'), - 'description' => '', - 'section' => 'coletivo_social', - 'live_title_id' => 'network', // apply for unput text and textarea only - 'title_format' => esc_html__('[live_title]', 'coletivo'), // [live_title] - 'max_item' => 9, // Maximum item can add - 'limited_msg' => esc_html__( 'Only 9 social networks allowed', 'coletivo' ), - 'fields' => array( - 'network' => array( - 'title' => esc_html__('Social network', 'coletivo'), - 'type' =>'text', - ), - 'icon' => array( - 'title' => esc_html__('Icon', 'coletivo'), - 'type' =>'icon', - ), - 'link' => array( - 'title' => esc_html__('URL', 'coletivo'), - 'type' =>'text', - ), - ), - ) - ) - ); + // Load custom controls. + require_once get_template_directory() . '/inc/customizer-controls.php'; - /*------------------------------------------------------------------------*/ - /* End of Section Social - /*------------------------------------------------------------------------*/ + // Remove default sections. + $wp_customize->remove_section( 'colors' ); + $wp_customize->remove_section( 'background_image' ); - /*------------------------------------------------------------------------*/ - /* Section: Sections - /*------------------------------------------------------------------------*/ - $wp_customize->add_section( 'coletivo_sections_options' , - array( - 'priority' => 130, - 'title' => esc_html__( 'Sections', 'coletivo' ), - 'description' => '', - ) - ); - // Social Profiles - $wp_customize->add_setting( - 'coletivo_section_order', - array( - //'default' => '', - 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', - 'transport' => 'refresh', // refresh or postMessage - ) ); + // Custom WP default control & settings. + $wp_customize->get_section( 'title_tagline' )->title = esc_html__( 'Site Title, Tagline & Logo', 'coletivo' ); + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; - $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( - $wp_customize, - 'coletivo_section_order', - array( - 'label' => esc_html__('Sections', 'coletivo'), - 'is_order_field'=> true, - 'description' => esc_html__('Organize with drag and drop to define sections order, open it to customize each one', 'coletivo'), - 'section' => 'coletivo_sections_options', - 'live_title_id' => 'section_order', // apply for unput text and textarea only - 'title_format' => __('[live_title] (Edit Section)', 'coletivo'), // [live_title] - 'max_item' => 200, // Maximum item can add - 'limited_msg' => '', - 'fields' => array(), + /** + * Hook to add other customize + */ + do_action( 'coletivo_customize_before_register', $wp_customize ); - ) - ) - ); - // Hidden field to reorder home sections - $wp_customize->add_setting( 'coletivo_sections_order', - array( - 'default' => apply_filters( 'coletivo_sections_order_default_value', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ) - ) - ); - $wp_customize->add_control( 'coletivo_sections_order', + $pages = get_pages(); + $option_pages = array(); + $option_pages[0] = __( 'Select page', 'coletivo' ); + foreach ( $pages as $p ) { + $option_pages[ $p->ID ] = $p->post_title; + } + $users = get_users( array( - 'type' => 'hidden', - 'section' => 'coletivo_sections_options' + 'orderby' => 'display_name', + 'order' => 'ASC', + 'number' => '', ) ); + $option_users[0] = __( 'Select member', 'coletivo' ); + foreach ( $users as $user ) { + $option_users[ $user->ID ] = $user->display_name; + } + + /** + * Settings Components + */ + require_once get_template_directory() . '/inc/customizer-components/customizer-site-identity.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-site-options.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-global-settings.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-header.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-footer.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-blog-page-settings.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-hero-options.php'; + + /** + * Sections Components + */ + require_once get_template_directory() . '/inc/customizer-components/customizer-section-hero.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-features.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-slider.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-featured-page.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-services.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-portfolio.php'; + // Jetpack section. + require_once get_template_directory() . '/inc/customizer-components/customizer-section-video-lightbox.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-gallery.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-team.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-news.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-contact.php'; + require_once get_template_directory() . '/inc/customizer-components/customizer-section-social.php'; + // Sections ordering. + require_once get_template_directory() . '/inc/customizer-components/customizer-section-sections.php'; /** * Hook to add other customize */ do_action( 'coletivo_customize_after_register', $wp_customize ); - } - add_action( 'customize_register', 'coletivo_customize_register' ); /** * Selective refresh */ -require get_template_directory() . '/inc/customizer-selective-refresh.php'; - -/*------------------------------------------------------------------------*/ -/* coletivo Sanitize Functions. -/*------------------------------------------------------------------------*/ +require_once get_template_directory() . '/inc/customizer-selective-refresh.php'; +/** + * Coletivo Sanitize Functions. + * + * @param string $file_url The URL file. + * + * @return string + */ function coletivo_sanitize_file_url( $file_url ) { - $output = ''; + $output = ''; $filetype = wp_check_filetype( $file_url ); - if ( $filetype["ext"] ) { + if ( $filetype['ext'] ) { $output = esc_url( $file_url ); } return $output; } /** - * Conditional to show more hero settings + * Conditional to show more hero settings. + * + * @param string $control The option of Hero Fullscreen. * - * @param $control * @return bool */ -function coletivo_hero_fullscreen_callback ( $control ) { - if ( $control->manager->get_setting('coletivo_hero_fullscreen')->value() == '' ) { - return true; - } else { - return false; - } +function coletivo_hero_fullscreen_callback( $control ) { + if ( $control->manager->get_setting( 'coletivo_hero_fullscreen' )->value() === '' ) { + return true; + } else { + return false; + } } - +/** + * Sanitize Number + * + * @param int $input The input number. + * + * @return int + */ function coletivo_sanitize_number( $input ) { - return balanceTags( $input ); + return balanceTags( $input ); } +/** + * Sanitize color + * + * @param string $color The color. + * + * @return string + */ function coletivo_sanitize_hex_color( $color ) { - if ( $color === '' ) { + if ( '' === $color ) { return ''; } - if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { + if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { return $color; } return null; } +/** + * Sanitize checkbox + * + * @param bool $input The checkbox option. + * + * @return bool + */ function coletivo_sanitize_checkbox( $input ) { - if ( $input == 1 ) { + if ( 1 === $input ) { return 1; - } else { + } else { return 0; - } + } } +/** + * Sanitize text + * + * @param string $string The input text. + * + * @return string + */ function coletivo_sanitize_text( $string ) { return wp_kses_post( balanceTags( $string ) ); } +/** + * Sanitize HTML + * + * @param string $string The URL. + * + * @return string + */ function coletivo_sanitize_html_input( $string ) { return wp_kses_allowed_html( $string ); } +/** + * Show on frontpage + * + * @return bool + */ function coletivo_showon_frontpage() { return is_page_template( 'template-frontpage.php' ); } +/** + * Show on frontpage when Jetpack is active + * + * @return bool + */ function coletivo_is_jetpack_active() { return is_page_template( 'template-frontpage.php' ) && class_exists( 'Jetpack' ); } + /** - * Remove deactivated sections - * @param array $sections + * Remove deactivated sections. + * + * @param array $sections The array sections. + * * @return array */ function coletivo_remove_deactivated_sections( $sections ) { - if ( in_array( 'portfolio', $sections ) && ! coletivo_is_jetpack_active() ) { - $key = array_search( 'portfolio', $sections ); + if ( in_array( 'portfolio', $sections, true ) && ! coletivo_is_jetpack_active() ) { + $key = array_search( 'portfolio', $sections, true ); unset( $sections[ $key ] ); } return $sections; } add_filter( 'coletivo_frontpage_sections_order', 'coletivo_remove_deactivated_sections', 9999 ); + /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function coletivo_customize_preview_js() { - wp_enqueue_script( 'coletivo_customizer_liveview', get_template_directory_uri() . '/assets/js/customizer-liveview.js', array( 'customize-preview', 'customize-selective-refresh' ), false, true ); + wp_enqueue_script( 'coletivo_customizer_liveview', get_template_directory_uri() . '/assets/js/customizer-liveview.js', array( 'customize-preview', 'customize-selective-refresh' ), VERSION, true ); } add_action( 'customize_preview_init', 'coletivo_customize_preview_js', 65 ); -add_action( 'customize_controls_enqueue_scripts', 'opneress_customize_js_settings' ); -function opneress_customize_js_settings(){ - if ( ! function_exists( 'coletivo_get_actions_required' ) ) { - return; - } - $actions = coletivo_get_actions_required(); - $n = array_count_values( $actions ); - $number_action = 0; - if ( $n && isset( $n['active'] ) ) { - $number_action = $n['active']; - } +/** + * Customizer JS settings + */ +function coletivo_customize_js_settings() { + if ( ! function_exists( 'coletivo_get_actions_required' ) ) { + return; + } + $actions = coletivo_get_actions_required(); + $n = array_count_values( $actions ); + $number_action = 0; + if ( $n && isset( $n['active'] ) ) { + $number_action = $n['active']; + } - wp_localize_script( 'customize-controls', 'coletivo_customizer_settings', array( - 'number_action' => $number_action, - 'is_plus_activated' => class_exists( 'coletivo_PLus' ) ? 'y' : 'n', - 'action_url' => admin_url( 'themes.php?page=ft_coletivo&tab=actions_required' ) - ) ); + wp_localize_script( + 'customize-controls', + 'coletivo_customizer_settings', + array( + 'number_action' => $number_action, + 'is_plus_activated' => class_exists( 'coletivo_PLUS' ) ? 'y' : 'n', + 'action_url' => admin_url( 'themes.php?page=ft_coletivo&tab=actions_required' ), + ) + ); } +add_action( 'customize_controls_enqueue_scripts', 'coletivo_customize_js_settings' ); /** * Customizer Icon picker */ -function coletivo_customize_controls_enqueue_scripts(){ - wp_localize_script( 'customize-controls', 'C_Icon_Picker', - apply_filters( 'c_icon_picker_js_setup', - array( - 'search' => esc_html__( 'Search', 'coletivo' ), - 'fonts' => array( - 'font-awesome' => array( - // Name of icon - 'name' => esc_html__( 'Font Awesome', 'coletivo' ), - // prefix class example for font-awesome fa-fa-{name} - 'prefix' => 'fa', - // font url - 'url' => esc_url( add_query_arg( array( 'ver'=> '4.7.0' ), get_template_directory_uri() .'/assets/css/font-awesome.min.css' ) ), - // Icon class name, separated by | - 'icons' => 'fa-glass|fa-music|fa-search|fa-envelope-o|fa-heart|fa-star|fa-star-o|fa-user|fa-film|fa-th-large|fa-th|fa-th-list|fa-check|fa-times|fa-search-plus|fa-search-minus|fa-power-off|fa-signal|fa-cog|fa-trash-o|fa-home|fa-file-o|fa-clock-o|fa-road|fa-download|fa-arrow-circle-o-down|fa-arrow-circle-o-up|fa-inbox|fa-play-circle-o|fa-repeat|fa-refresh|fa-list-alt|fa-lock|fa-flag|fa-headphones|fa-volume-off|fa-volume-down|fa-volume-up|fa-qrcode|fa-barcode|fa-tag|fa-tags|fa-book|fa-bookmark|fa-print|fa-camera|fa-font|fa-bold|fa-italic|fa-text-height|fa-text-width|fa-align-left|fa-align-center|fa-align-right|fa-align-justify|fa-list|fa-outdent|fa-indent|fa-video-camera|fa-picture-o|fa-pencil|fa-map-marker|fa-adjust|fa-tint|fa-pencil-square-o|fa-share-square-o|fa-check-square-o|fa-arrows|fa-step-backward|fa-fast-backward|fa-backward|fa-play|fa-pause|fa-stop|fa-forward|fa-fast-forward|fa-step-forward|fa-eject|fa-chevron-left|fa-chevron-right|fa-plus-circle|fa-minus-circle|fa-times-circle|fa-check-circle|fa-question-circle|fa-info-circle|fa-crosshairs|fa-times-circle-o|fa-check-circle-o|fa-ban|fa-arrow-left|fa-arrow-right|fa-arrow-up|fa-arrow-down|fa-share|fa-expand|fa-compress|fa-plus|fa-minus|fa-asterisk|fa-exclamation-circle|fa-gift|fa-leaf|fa-fire|fa-eye|fa-eye-slash|fa-exclamation-triangle|fa-plane|fa-calendar|fa-random|fa-comment|fa-magnet|fa-chevron-up|fa-chevron-down|fa-retweet|fa-shopping-cart|fa-folder|fa-folder-open|fa-arrows-v|fa-arrows-h|fa-bar-chart|fa-twitter-square|fa-facebook-square|fa-camera-retro|fa-key|fa-cogs|fa-comments|fa-thumbs-o-up|fa-thumbs-o-down|fa-star-half|fa-heart-o|fa-sign-out|fa-linkedin-square|fa-thumb-tack|fa-external-link|fa-sign-in|fa-trophy|fa-github-square|fa-upload|fa-lemon-o|fa-phone|fa-square-o|fa-bookmark-o|fa-phone-square|fa-twitter|fa-facebook|fa-github|fa-unlock|fa-credit-card|fa-rss|fa-hdd-o|fa-bullhorn|fa-bell|fa-certificate|fa-hand-o-right|fa-hand-o-left|fa-hand-o-up|fa-hand-o-down|fa-arrow-circle-left|fa-arrow-circle-right|fa-arrow-circle-up|fa-arrow-circle-down|fa-globe|fa-wrench|fa-tasks|fa-filter|fa-briefcase|fa-arrows-alt|fa-users|fa-link|fa-cloud|fa-flask|fa-scissors|fa-files-o|fa-paperclip|fa-floppy-o|fa-square|fa-bars|fa-list-ul|fa-list-ol|fa-strikethrough|fa-underline|fa-table|fa-magic|fa-truck|fa-pinterest|fa-pinterest-square|fa-google-plus-square|fa-google-plus|fa-money|fa-caret-down|fa-caret-up|fa-caret-left|fa-caret-right|fa-columns|fa-sort|fa-sort-desc|fa-sort-asc|fa-envelope|fa-linkedin|fa-undo|fa-gavel|fa-tachometer|fa-comment-o|fa-comments-o|fa-bolt|fa-sitemap|fa-umbrella|fa-clipboard|fa-lightbulb-o|fa-exchange|fa-cloud-download|fa-cloud-upload|fa-user-md|fa-stethoscope|fa-suitcase|fa-bell-o|fa-coffee|fa-cutlery|fa-file-text-o|fa-building-o|fa-hospital-o|fa-ambulance|fa-medkit|fa-fighter-jet|fa-beer|fa-h-square|fa-plus-square|fa-angle-double-left|fa-angle-double-right|fa-angle-double-up|fa-angle-double-down|fa-angle-left|fa-angle-right|fa-angle-up|fa-angle-down|fa-desktop|fa-laptop|fa-tablet|fa-mobile|fa-circle-o|fa-quote-left|fa-quote-right|fa-spinner|fa-circle|fa-reply|fa-github-alt|fa-folder-o|fa-folder-open-o|fa-smile-o|fa-frown-o|fa-meh-o|fa-gamepad|fa-keyboard-o|fa-flag-o|fa-flag-checkered|fa-terminal|fa-code|fa-reply-all|fa-star-half-o|fa-location-arrow|fa-crop|fa-code-fork|fa-chain-broken|fa-question|fa-info|fa-exclamation|fa-superscript|fa-subscript|fa-eraser|fa-puzzle-piece|fa-microphone|fa-microphone-slash|fa-shield|fa-calendar-o|fa-fire-extinguisher|fa-rocket|fa-maxcdn|fa-chevron-circle-left|fa-chevron-circle-right|fa-chevron-circle-up|fa-chevron-circle-down|fa-html5|fa-css3|fa-anchor|fa-unlock-alt|fa-bullseye|fa-ellipsis-h|fa-ellipsis-v|fa-rss-square|fa-play-circle|fa-ticket|fa-minus-square|fa-minus-square-o|fa-level-up|fa-level-down|fa-check-square|fa-pencil-square|fa-external-link-square|fa-share-square|fa-compass|fa-caret-square-o-down|fa-caret-square-o-up|fa-caret-square-o-right|fa-eur|fa-gbp|fa-usd|fa-inr|fa-jpy|fa-rub|fa-krw|fa-btc|fa-file|fa-file-text|fa-sort-alpha-asc|fa-sort-alpha-desc|fa-sort-amount-asc|fa-sort-amount-desc|fa-sort-numeric-asc|fa-sort-numeric-desc|fa-thumbs-up|fa-thumbs-down|fa-youtube-square|fa-youtube|fa-xing|fa-xing-square|fa-youtube-play|fa-dropbox|fa-stack-overflow|fa-instagram|fa-flickr|fa-adn|fa-bitbucket|fa-bitbucket-square|fa-tumblr|fa-tumblr-square|fa-long-arrow-down|fa-long-arrow-up|fa-long-arrow-left|fa-long-arrow-right|fa-apple|fa-windows|fa-android|fa-linux|fa-dribbble|fa-skype|fa-foursquare|fa-trello|fa-female|fa-male|fa-gratipay|fa-sun-o|fa-moon-o|fa-archive|fa-bug|fa-vk|fa-weibo|fa-renren|fa-pagelines|fa-stack-exchange|fa-arrow-circle-o-right|fa-arrow-circle-o-left|fa-caret-square-o-left|fa-dot-circle-o|fa-wheelchair|fa-vimeo-square|fa-try|fa-plus-square-o|fa-space-shuttle|fa-slack|fa-envelope-square|fa-wordpress|fa-openid|fa-university|fa-graduation-cap|fa-yahoo|fa-google|fa-reddit|fa-reddit-square|fa-stumbleupon-circle|fa-stumbleupon|fa-delicious|fa-digg|fa-pied-piper-pp|fa-pied-piper-alt|fa-drupal|fa-joomla|fa-language|fa-fax|fa-building|fa-child|fa-paw|fa-spoon|fa-cube|fa-cubes|fa-behance|fa-behance-square|fa-steam|fa-steam-square|fa-recycle|fa-car|fa-taxi|fa-tree|fa-spotify|fa-deviantart|fa-soundcloud|fa-database|fa-file-pdf-o|fa-file-word-o|fa-file-excel-o|fa-file-powerpoint-o|fa-file-image-o|fa-file-archive-o|fa-file-audio-o|fa-file-video-o|fa-file-code-o|fa-vine|fa-codepen|fa-jsfiddle|fa-life-ring|fa-circle-o-notch|fa-rebel|fa-empire|fa-git-square|fa-git|fa-hacker-news|fa-tencent-weibo|fa-qq|fa-weixin|fa-paper-plane|fa-paper-plane-o|fa-history|fa-circle-thin|fa-header|fa-paragraph|fa-sliders|fa-share-alt|fa-share-alt-square|fa-bomb|fa-futbol-o|fa-tty|fa-binoculars|fa-plug|fa-slideshare|fa-twitch|fa-yelp|fa-newspaper-o|fa-wifi|fa-calculator|fa-paypal|fa-google-wallet|fa-cc-visa|fa-cc-mastercard|fa-cc-discover|fa-cc-amex|fa-cc-paypal|fa-cc-stripe|fa-bell-slash|fa-bell-slash-o|fa-trash|fa-copyright|fa-at|fa-eyedropper|fa-paint-brush|fa-birthday-cake|fa-area-chart|fa-pie-chart|fa-line-chart|fa-lastfm|fa-lastfm-square|fa-toggle-off|fa-toggle-on|fa-bicycle|fa-bus|fa-ioxhost|fa-angellist|fa-cc|fa-ils|fa-meanpath|fa-buysellads|fa-connectdevelop|fa-dashcube|fa-forumbee|fa-leanpub|fa-sellsy|fa-shirtsinbulk|fa-simplybuilt|fa-skyatlas|fa-cart-plus|fa-cart-arrow-down|fa-diamond|fa-ship|fa-user-secret|fa-motorcycle|fa-street-view|fa-heartbeat|fa-venus|fa-mars|fa-mercury|fa-transgender|fa-transgender-alt|fa-venus-double|fa-mars-double|fa-venus-mars|fa-mars-stroke|fa-mars-stroke-v|fa-mars-stroke-h|fa-neuter|fa-genderless|fa-facebook-official|fa-pinterest-p|fa-whatsapp|fa-server|fa-user-plus|fa-user-times|fa-bed|fa-viacoin|fa-train|fa-subway|fa-medium|fa-y-combinator|fa-optin-monster|fa-opencart|fa-expeditedssl|fa-battery-full|fa-battery-three-quarters|fa-battery-half|fa-battery-quarter|fa-battery-empty|fa-mouse-pointer|fa-i-cursor|fa-object-group|fa-object-ungroup|fa-sticky-note|fa-sticky-note-o|fa-cc-jcb|fa-cc-diners-club|fa-clone|fa-balance-scale|fa-hourglass-o|fa-hourglass-start|fa-hourglass-half|fa-hourglass-end|fa-hourglass|fa-hand-rock-o|fa-hand-paper-o|fa-hand-scissors-o|fa-hand-lizard-o|fa-hand-spock-o|fa-hand-pointer-o|fa-hand-peace-o|fa-trademark|fa-registered|fa-creative-commons|fa-gg|fa-gg-circle|fa-tripadvisor|fa-odnoklassniki|fa-odnoklassniki-square|fa-get-pocket|fa-wikipedia-w|fa-safari|fa-chrome|fa-firefox|fa-opera|fa-internet-explorer|fa-television|fa-contao|fa-500px|fa-amazon|fa-calendar-plus-o|fa-calendar-minus-o|fa-calendar-times-o|fa-calendar-check-o|fa-industry|fa-map-pin|fa-map-signs|fa-map-o|fa-map|fa-commenting|fa-commenting-o|fa-houzz|fa-vimeo|fa-black-tie|fa-fonticons|fa-reddit-alien|fa-edge|fa-credit-card-alt|fa-codiepie|fa-modx|fa-fort-awesome|fa-usb|fa-product-hunt|fa-mixcloud|fa-scribd|fa-pause-circle|fa-pause-circle-o|fa-stop-circle|fa-stop-circle-o|fa-shopping-bag|fa-shopping-basket|fa-hashtag|fa-bluetooth|fa-bluetooth-b|fa-percent|fa-gitlab|fa-wpbeginner|fa-wpforms|fa-envira|fa-universal-access|fa-wheelchair-alt|fa-question-circle-o|fa-blind|fa-audio-description|fa-volume-control-phone|fa-braille|fa-assistive-listening-systems|fa-american-sign-language-interpreting|fa-deaf|fa-glide|fa-glide-g|fa-sign-language|fa-low-vision|fa-viadeo|fa-viadeo-square|fa-snapchat|fa-snapchat-ghost|fa-snapchat-square|fa-pied-piper|fa-first-order|fa-yoast|fa-themeisle|fa-google-plus-official|fa-font-awesome|fa-handshake-o|fa-envelope-open|fa-envelope-open-o|fa-linode|fa-address-book|fa-address-book-o|fa-address-card|fa-address-card-o|fa-user-circle|fa-user-circle-o|fa-user-o|fa-id-badge|fa-id-card|fa-id-card-o|fa-quora|fa-free-code-camp|fa-telegram|fa-thermometer-full|fa-thermometer-three-quarters|fa-thermometer-half|fa-thermometer-quarter|fa-thermometer-empty|fa-shower|fa-bath|fa-podcast|fa-window-maximize|fa-window-minimize|fa-window-restore|fa-window-close|fa-window-close-o|fa-bandcamp|fa-grav|fa-etsy|fa-imdb|fa-ravelry|fa-eercast|fa-microchip|fa-snowflake-o|fa-superpowers|fa-wpexplorer|fa-meetup' - ), - ) - ) - ) - ); +function coletivo_customize_controls_enqueue_scripts() { + wp_localize_script( + 'customize-controls', + 'C_Icon_Picker', + apply_filters( + 'c_icon_picker_js_setup', + array( + 'search' => esc_html__( 'Search', 'coletivo' ), + 'fonts' => array( + 'font-awesome' => array( + // Name of icon. + 'name' => esc_html__( 'Font Awesome', 'coletivo' ), + // prefix class example for font-awesome fa-fa-{name}. + 'prefix' => 'fa', + // font url. + 'url' => esc_url( add_query_arg( array( 'ver' => '4.7.0' ), get_template_directory_uri() . '/assets/css/font-awesome.min.css' ) ), + // Icon class name, separated by |. + 'icons' => 'fa-glass|fa-music|fa-search|fa-envelope-o|fa-heart|fa-star|fa-star-o|fa-user|fa-film|fa-th-large|fa-th|fa-th-list|fa-check|fa-times|fa-search-plus|fa-search-minus|fa-power-off|fa-signal|fa-cog|fa-trash-o|fa-home|fa-file-o|fa-clock-o|fa-road|fa-download|fa-arrow-circle-o-down|fa-arrow-circle-o-up|fa-inbox|fa-play-circle-o|fa-repeat|fa-refresh|fa-list-alt|fa-lock|fa-flag|fa-headphones|fa-volume-off|fa-volume-down|fa-volume-up|fa-qrcode|fa-barcode|fa-tag|fa-tags|fa-book|fa-bookmark|fa-print|fa-camera|fa-font|fa-bold|fa-italic|fa-text-height|fa-text-width|fa-align-left|fa-align-center|fa-align-right|fa-align-justify|fa-list|fa-outdent|fa-indent|fa-video-camera|fa-picture-o|fa-pencil|fa-map-marker|fa-adjust|fa-tint|fa-pencil-square-o|fa-share-square-o|fa-check-square-o|fa-arrows|fa-step-backward|fa-fast-backward|fa-backward|fa-play|fa-pause|fa-stop|fa-forward|fa-fast-forward|fa-step-forward|fa-eject|fa-chevron-left|fa-chevron-right|fa-plus-circle|fa-minus-circle|fa-times-circle|fa-check-circle|fa-question-circle|fa-info-circle|fa-crosshairs|fa-times-circle-o|fa-check-circle-o|fa-ban|fa-arrow-left|fa-arrow-right|fa-arrow-up|fa-arrow-down|fa-share|fa-expand|fa-compress|fa-plus|fa-minus|fa-asterisk|fa-exclamation-circle|fa-gift|fa-leaf|fa-fire|fa-eye|fa-eye-slash|fa-exclamation-triangle|fa-plane|fa-calendar|fa-random|fa-comment|fa-magnet|fa-chevron-up|fa-chevron-down|fa-retweet|fa-shopping-cart|fa-folder|fa-folder-open|fa-arrows-v|fa-arrows-h|fa-bar-chart|fa-twitter-square|fa-facebook-square|fa-camera-retro|fa-key|fa-cogs|fa-comments|fa-thumbs-o-up|fa-thumbs-o-down|fa-star-half|fa-heart-o|fa-sign-out|fa-linkedin-square|fa-thumb-tack|fa-external-link|fa-sign-in|fa-trophy|fa-github-square|fa-upload|fa-lemon-o|fa-phone|fa-square-o|fa-bookmark-o|fa-phone-square|fa-twitter|fa-facebook|fa-github|fa-unlock|fa-credit-card|fa-rss|fa-hdd-o|fa-bullhorn|fa-bell|fa-certificate|fa-hand-o-right|fa-hand-o-left|fa-hand-o-up|fa-hand-o-down|fa-arrow-circle-left|fa-arrow-circle-right|fa-arrow-circle-up|fa-arrow-circle-down|fa-globe|fa-wrench|fa-tasks|fa-filter|fa-briefcase|fa-arrows-alt|fa-users|fa-link|fa-cloud|fa-flask|fa-scissors|fa-files-o|fa-paperclip|fa-floppy-o|fa-square|fa-bars|fa-list-ul|fa-list-ol|fa-strikethrough|fa-underline|fa-table|fa-magic|fa-truck|fa-pinterest|fa-pinterest-square|fa-google-plus-square|fa-google-plus|fa-money|fa-caret-down|fa-caret-up|fa-caret-left|fa-caret-right|fa-columns|fa-sort|fa-sort-desc|fa-sort-asc|fa-envelope|fa-linkedin|fa-undo|fa-gavel|fa-tachometer|fa-comment-o|fa-comments-o|fa-bolt|fa-sitemap|fa-umbrella|fa-clipboard|fa-lightbulb-o|fa-exchange|fa-cloud-download|fa-cloud-upload|fa-user-md|fa-stethoscope|fa-suitcase|fa-bell-o|fa-coffee|fa-cutlery|fa-file-text-o|fa-building-o|fa-hospital-o|fa-ambulance|fa-medkit|fa-fighter-jet|fa-beer|fa-h-square|fa-plus-square|fa-angle-double-left|fa-angle-double-right|fa-angle-double-up|fa-angle-double-down|fa-angle-left|fa-angle-right|fa-angle-up|fa-angle-down|fa-desktop|fa-laptop|fa-tablet|fa-mobile|fa-circle-o|fa-quote-left|fa-quote-right|fa-spinner|fa-circle|fa-reply|fa-github-alt|fa-folder-o|fa-folder-open-o|fa-smile-o|fa-frown-o|fa-meh-o|fa-gamepad|fa-keyboard-o|fa-flag-o|fa-flag-checkered|fa-terminal|fa-code|fa-reply-all|fa-star-half-o|fa-location-arrow|fa-crop|fa-code-fork|fa-chain-broken|fa-question|fa-info|fa-exclamation|fa-superscript|fa-subscript|fa-eraser|fa-puzzle-piece|fa-microphone|fa-microphone-slash|fa-shield|fa-calendar-o|fa-fire-extinguisher|fa-rocket|fa-maxcdn|fa-chevron-circle-left|fa-chevron-circle-right|fa-chevron-circle-up|fa-chevron-circle-down|fa-html5|fa-css3|fa-anchor|fa-unlock-alt|fa-bullseye|fa-ellipsis-h|fa-ellipsis-v|fa-rss-square|fa-play-circle|fa-ticket|fa-minus-square|fa-minus-square-o|fa-level-up|fa-level-down|fa-check-square|fa-pencil-square|fa-external-link-square|fa-share-square|fa-compass|fa-caret-square-o-down|fa-caret-square-o-up|fa-caret-square-o-right|fa-eur|fa-gbp|fa-usd|fa-inr|fa-jpy|fa-rub|fa-krw|fa-btc|fa-file|fa-file-text|fa-sort-alpha-asc|fa-sort-alpha-desc|fa-sort-amount-asc|fa-sort-amount-desc|fa-sort-numeric-asc|fa-sort-numeric-desc|fa-thumbs-up|fa-thumbs-down|fa-youtube-square|fa-youtube|fa-xing|fa-xing-square|fa-youtube-play|fa-dropbox|fa-stack-overflow|fa-instagram|fa-flickr|fa-adn|fa-bitbucket|fa-bitbucket-square|fa-tumblr|fa-tumblr-square|fa-long-arrow-down|fa-long-arrow-up|fa-long-arrow-left|fa-long-arrow-right|fa-apple|fa-windows|fa-android|fa-linux|fa-dribbble|fa-skype|fa-foursquare|fa-trello|fa-female|fa-male|fa-gratipay|fa-sun-o|fa-moon-o|fa-archive|fa-bug|fa-vk|fa-weibo|fa-renren|fa-pagelines|fa-stack-exchange|fa-arrow-circle-o-right|fa-arrow-circle-o-left|fa-caret-square-o-left|fa-dot-circle-o|fa-wheelchair|fa-vimeo-square|fa-try|fa-plus-square-o|fa-space-shuttle|fa-slack|fa-envelope-square|fa-wordpress|fa-openid|fa-university|fa-graduation-cap|fa-yahoo|fa-google|fa-reddit|fa-reddit-square|fa-stumbleupon-circle|fa-stumbleupon|fa-delicious|fa-digg|fa-pied-piper-pp|fa-pied-piper-alt|fa-drupal|fa-joomla|fa-language|fa-fax|fa-building|fa-child|fa-paw|fa-spoon|fa-cube|fa-cubes|fa-behance|fa-behance-square|fa-steam|fa-steam-square|fa-recycle|fa-car|fa-taxi|fa-tree|fa-spotify|fa-deviantart|fa-soundcloud|fa-database|fa-file-pdf-o|fa-file-word-o|fa-file-excel-o|fa-file-powerpoint-o|fa-file-image-o|fa-file-archive-o|fa-file-audio-o|fa-file-video-o|fa-file-code-o|fa-vine|fa-codepen|fa-jsfiddle|fa-life-ring|fa-circle-o-notch|fa-rebel|fa-empire|fa-git-square|fa-git|fa-hacker-news|fa-tencent-weibo|fa-qq|fa-weixin|fa-paper-plane|fa-paper-plane-o|fa-history|fa-circle-thin|fa-header|fa-paragraph|fa-sliders|fa-share-alt|fa-share-alt-square|fa-bomb|fa-futbol-o|fa-tty|fa-binoculars|fa-plug|fa-slideshare|fa-twitch|fa-yelp|fa-newspaper-o|fa-wifi|fa-calculator|fa-paypal|fa-google-wallet|fa-cc-visa|fa-cc-mastercard|fa-cc-discover|fa-cc-amex|fa-cc-paypal|fa-cc-stripe|fa-bell-slash|fa-bell-slash-o|fa-trash|fa-copyright|fa-at|fa-eyedropper|fa-paint-brush|fa-birthday-cake|fa-area-chart|fa-pie-chart|fa-line-chart|fa-lastfm|fa-lastfm-square|fa-toggle-off|fa-toggle-on|fa-bicycle|fa-bus|fa-ioxhost|fa-angellist|fa-cc|fa-ils|fa-meanpath|fa-buysellads|fa-connectdevelop|fa-dashcube|fa-forumbee|fa-leanpub|fa-sellsy|fa-shirtsinbulk|fa-simplybuilt|fa-skyatlas|fa-cart-plus|fa-cart-arrow-down|fa-diamond|fa-ship|fa-user-secret|fa-motorcycle|fa-street-view|fa-heartbeat|fa-venus|fa-mars|fa-mercury|fa-transgender|fa-transgender-alt|fa-venus-double|fa-mars-double|fa-venus-mars|fa-mars-stroke|fa-mars-stroke-v|fa-mars-stroke-h|fa-neuter|fa-genderless|fa-facebook-official|fa-pinterest-p|fa-whatsapp|fa-server|fa-user-plus|fa-user-times|fa-bed|fa-viacoin|fa-train|fa-subway|fa-medium|fa-y-combinator|fa-optin-monster|fa-opencart|fa-expeditedssl|fa-battery-full|fa-battery-three-quarters|fa-battery-half|fa-battery-quarter|fa-battery-empty|fa-mouse-pointer|fa-i-cursor|fa-object-group|fa-object-ungroup|fa-sticky-note|fa-sticky-note-o|fa-cc-jcb|fa-cc-diners-club|fa-clone|fa-balance-scale|fa-hourglass-o|fa-hourglass-start|fa-hourglass-half|fa-hourglass-end|fa-hourglass|fa-hand-rock-o|fa-hand-paper-o|fa-hand-scissors-o|fa-hand-lizard-o|fa-hand-spock-o|fa-hand-pointer-o|fa-hand-peace-o|fa-trademark|fa-registered|fa-creative-commons|fa-gg|fa-gg-circle|fa-tripadvisor|fa-odnoklassniki|fa-odnoklassniki-square|fa-get-pocket|fa-wikipedia-w|fa-safari|fa-chrome|fa-firefox|fa-opera|fa-internet-explorer|fa-television|fa-contao|fa-500px|fa-amazon|fa-calendar-plus-o|fa-calendar-minus-o|fa-calendar-times-o|fa-calendar-check-o|fa-industry|fa-map-pin|fa-map-signs|fa-map-o|fa-map|fa-commenting|fa-commenting-o|fa-houzz|fa-vimeo|fa-black-tie|fa-fonticons|fa-reddit-alien|fa-edge|fa-credit-card-alt|fa-codiepie|fa-modx|fa-fort-awesome|fa-usb|fa-product-hunt|fa-mixcloud|fa-scribd|fa-pause-circle|fa-pause-circle-o|fa-stop-circle|fa-stop-circle-o|fa-shopping-bag|fa-shopping-basket|fa-hashtag|fa-bluetooth|fa-bluetooth-b|fa-percent|fa-gitlab|fa-wpbeginner|fa-wpforms|fa-envira|fa-universal-access|fa-wheelchair-alt|fa-question-circle-o|fa-blind|fa-audio-description|fa-volume-control-phone|fa-braille|fa-assistive-listening-systems|fa-american-sign-language-interpreting|fa-deaf|fa-glide|fa-glide-g|fa-sign-language|fa-low-vision|fa-viadeo|fa-viadeo-square|fa-snapchat|fa-snapchat-ghost|fa-snapchat-square|fa-pied-piper|fa-first-order|fa-yoast|fa-themeisle|fa-google-plus-official|fa-font-awesome|fa-handshake-o|fa-envelope-open|fa-envelope-open-o|fa-linode|fa-address-book|fa-address-book-o|fa-address-card|fa-address-card-o|fa-user-circle|fa-user-circle-o|fa-user-o|fa-id-badge|fa-id-card|fa-id-card-o|fa-quora|fa-free-code-camp|fa-telegram|fa-thermometer-full|fa-thermometer-three-quarters|fa-thermometer-half|fa-thermometer-quarter|fa-thermometer-empty|fa-shower|fa-bath|fa-podcast|fa-window-maximize|fa-window-minimize|fa-window-restore|fa-window-close|fa-window-close-o|fa-bandcamp|fa-grav|fa-etsy|fa-imdb|fa-ravelry|fa-eercast|fa-microchip|fa-snowflake-o|fa-superpowers|fa-wpexplorer|fa-meetup', + ), + ), + ) + ) + ); } add_action( 'customize_controls_enqueue_scripts', 'coletivo_customize_controls_enqueue_scripts' ); /** * Get customizer panel priority - * @param string $panel + * + * @param string $panel The customizer panel. + * * @return int */ -function coletivo_get_customizer_priority ( $panel ) { +function coletivo_get_customizer_priority( $panel ) { $panel = str_replace( array( 'coletivo_', '_panel' ), '', $panel ); $order = get_theme_mod( 'coletivo_sections_order', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ); $index = 129; From 00520c2c6d28e8e38a74c3ee2bc4fde6ceaca176 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Thu, 6 May 2021 19:45:23 -0300 Subject: [PATCH 06/32] Coding standards em arquivos do customizer - customizer-controls.php; - customizer-selective-refresh.php; - customizer-update-fields.php. --- inc/customizer-controls.php | 1458 ++++++++++++++------------ inc/customizer-selective-refresh.php | 650 ++++++------ inc/customizer-update-fields.php | 27 +- 3 files changed, 1173 insertions(+), 962 deletions(-) diff --git a/inc/customizer-controls.php b/inc/customizer-controls.php index d867161..d75ee4a 100644 --- a/inc/customizer-controls.php +++ b/inc/customizer-controls.php @@ -1,15 +1,35 @@ type ) { - default: - case 'heading': - echo '' . $this->title . ''; + echo '' . esc_html( $this->title ) . ''; break; - case 'custom_message' : - echo '

    ' . $this->description . '

    '; + case 'custom_message': + echo '

    ' . esc_html( $this->description ) . '

    '; break; - case 'hr' : + case 'hr': echo '
    '; break; } } } -class Coletivo_Textarea_Custom_Control extends WP_Customize_Control -{ +/** + * Text Area Custom Control Class + */ +class Coletivo_Textarea_Custom_Control extends WP_Customize_Control { + /** + * Render the description and title for the sections + */ public function render_content() { ?> ]*?>.*?@si', '', $string ); - $string = strip_tags($string); - return trim( $string ); +function coletivo_sanitize_css( $string ) { + $string = preg_replace( '@<(script|style)[^>]*?>.*?@si', '', $string ); + $string = wp_strip_all_tags( $string ); + return trim( $string ); } +/** + * Sanitize color alpha + * + * @param string $color The color value. + * + * @return string + */ +function coletivo_sanitize_color_alpha( $color ) { + $color = str_replace( '#', '', $color ); + if ( '' === $color ) { + return ''; + } -function coletivo_sanitize_color_alpha( $color ){ - $color = str_replace( '#', '', $color ); - if ( '' === $color ){ - return ''; - } - - // 3 or 6 hex digits, or the empty string. - if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', '#' . $color ) ) { - // convert to rgb - $colour = $color; - if ( strlen( $colour ) == 6 ) { - list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] ); - } elseif ( strlen( $colour ) == 3 ) { - list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] ); - } else { - return false; - } - $r = hexdec( $r ); - $g = hexdec( $g ); - $b = hexdec( $b ); - return 'rgba('.join( ',', array( 'r' => $r, 'g' => $g, 'b' => $b, 'a' => 1 ) ).')'; - - } - - return strpos( trim( $color ), 'rgb' ) !== false ? $color : false; + // 3 or 6 hex digits, or the empty string. + if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', '#' . $color ) ) { + // convert to rgb. + $colour = $color; + if ( 6 === strlen( $colour ) ) { + list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] ); + } elseif ( 3 === strlen( $colour ) ) { + list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] ); + } else { + return false; + } + $r = hexdec( $r ); + $g = hexdec( $g ); + $b = hexdec( $b ); + return 'rgba( ' . join( + ',', + array( + 'r' => $r, + 'g' => $g, + 'b' => $b, + 'a' => 1, + ) + ) . ')'; + + } + + return false !== strpos( trim( $color ), 'rgb' ) ? $color : false; } /** * Sanitize repeatable data * - * @param $input - * @param $setting object $wp_customize + * @param string $input The input string. + * @param object $setting $wp_customize. + * * @return bool|mixed|string|void */ -function coletivo_sanitize_repeatable_data_field( $input , $setting ){ - $control = $setting->manager->get_control( $setting->id ); - - $fields = $control->fields; - if ( is_string( $input ) ) { - $input = json_decode( wp_unslash( $input ) , true ); - } - $data = wp_parse_args( $input, array() ); - - if ( ! is_array( $data ) ) { - return false; - } - if ( ! isset( $data['_items'] ) ) { - return false; - } - $data = $data['_items']; - - foreach( $data as $i => $item_data ){ - foreach( $item_data as $id => $value ){ - - if ( isset( $fields[ $id ] ) ){ - switch( strtolower( $fields[ $id ]['type'] ) ) { - case 'text': - $data[ $i ][ $id ] = sanitize_text_field( $value ); - break; - case 'textarea': - case 'editor': - $data[ $i ][ $id ] = wp_kses_post( $value ); - break; - case 'color': - $data[ $i ][ $id ] = sanitize_hex_color_no_hash( $value ); - break; - case 'coloralpha': - $data[ $i ][ $id ] = coletivo_sanitize_color_alpha( $value ); - break; - case 'checkbox': - $data[ $i ][ $id ] = coletivo_sanitize_checkbox( $value ); - break; - case 'select': - $data[ $i ][ $id ] = ''; - if ( is_array( $fields[ $id ]['options'] ) && ! empty( $fields[ $id ]['options'] ) ){ - // if is multiple choices - if ( is_array( $value ) ) { - foreach ( $value as $k => $v ) { - if ( isset( $fields[ $id ]['options'][ $v ] ) ) { - $value [ $k ] = $v; - } - } - $data[ $i ][ $id ] = $value; - }else { // is single choice - if ( isset( $fields[ $id ]['options'][ $value ] ) ) { - $data[ $i ][ $id ] = $value; - } - } - } - - break; - case 'radio': - $data[ $i ][ $id ] = sanitize_text_field( $value ); - break; - case 'media': - $value = wp_parse_args( $value, - array( - 'url' => '', - 'id'=> false - ) - ); - $value['id'] = absint( $value['id'] ); - $data[ $i ][ $id ]['url'] = sanitize_text_field( $value['url'] ); - - if ( $url = wp_get_attachment_url( $value['id'] ) ) { - $data[ $i ][ $id ]['id'] = $value['id']; - $data[ $i ][ $id ]['url'] = $url; - } else { - $data[ $i ][ $id ]['id'] = ''; - } - - break; - default: - $data[ $i ][ $id ] = wp_kses_post( $value ); - } - - }else { - $data[ $i ][ $id ] = wp_kses_post( $value ); - } - - if ( count( $data[ $i ] ) != count( $fields ) ) { - foreach ( $fields as $k => $f ){ - if ( ! isset( $data[ $i ][ $k ] ) ) { - $data[ $i ][ $k ] = ''; - } - } - } - - } - } - - return $data; +function coletivo_sanitize_repeatable_data_field( $input, $setting ) { + $control = $setting->manager->get_control( $setting->id ); + + $fields = $control->fields; + if ( is_string( $input ) ) { + $input = json_decode( wp_unslash( $input ), true ); + } + $data = wp_parse_args( $input, array() ); + + if ( ! is_array( $data ) ) { + return false; + } + if ( ! isset( $data['_items'] ) ) { + return false; + } + $data = $data['_items']; + + foreach ( $data as $i => $item_data ) { + foreach ( $item_data as $id => $value ) { + + if ( isset( $fields[ $id ] ) ) { + switch ( strtolower( $fields[ $id ]['type'] ) ) { + case 'text': + $data[ $i ][ $id ] = sanitize_text_field( $value ); + break; + case 'textarea': + case 'editor': + $data[ $i ][ $id ] = wp_kses_post( $value ); + break; + case 'color': + $data[ $i ][ $id ] = sanitize_hex_color_no_hash( $value ); + break; + case 'coloralpha': + $data[ $i ][ $id ] = coletivo_sanitize_color_alpha( $value ); + break; + case 'checkbox': + $data[ $i ][ $id ] = coletivo_sanitize_checkbox( $value ); + break; + case 'select': + $data[ $i ][ $id ] = ''; + if ( is_array( $fields[ $id ]['options'] ) && ! empty( $fields[ $id ]['options'] ) ) { + // if is multiple choices. + if ( is_array( $value ) ) { + foreach ( $value as $k => $v ) { + if ( isset( $fields[ $id ]['options'][ $v ] ) ) { + $value [ $k ] = $v; + } + } + $data[ $i ][ $id ] = $value; + } else { // is single choice. + if ( isset( $fields[ $id ]['options'][ $value ] ) ) { + $data[ $i ][ $id ] = $value; + } + } + } + + break; + case 'radio': + $data[ $i ][ $id ] = sanitize_text_field( $value ); + break; + case 'media': + $value = wp_parse_args( + $value, + array( + 'url' => '', + 'id' => false, + ) + ); + + $value['id'] = absint( $value['id'] ); + $data[ $i ][ $id ]['url'] = sanitize_text_field( $value['url'] ); + + if ( wp_get_attachment_url( $value['id'] ) === $url ) { + $data[ $i ][ $id ]['id'] = $value['id']; + $data[ $i ][ $id ]['url'] = $url; + } else { + $data[ $i ][ $id ]['id'] = ''; + } + + break; + default: + $data[ $i ][ $id ] = wp_kses_post( $value ); + } + } else { + $data[ $i ][ $id ] = wp_kses_post( $value ); + } + + if ( count( $data[ $i ] ) !== count( $fields ) ) { + foreach ( $fields as $k => $f ) { + if ( ! isset( $data[ $i ][ $k ] ) ) { + $data[ $i ][ $k ] = ''; + } + } + } + } + } + + return $data; } +/** + * Editor Custom Control Class + */ +class Coletivo_Editor_Custom_Control extends WP_Customize_Control { + /** + * The type of customize control being rendered. + * + * @since 1.0.0 + * @access public + * @var string + */ + public $type = 'wp_editor'; -class coletivo_Editor_Custom_Control extends WP_Customize_Control -{ - /** - * The type of customize control being rendered. - * - * @since 1.0.0 - * @access public - * @var string - */ - public $type = 'wp_editor'; - - /** - * Add support for palettes to be passed in. - * - * Supported palette values are true, false, or an array of RGBa and Hex colors. - */ - public $mod; - - public function render_content() { - $this->mod = strtolower( $this->mod ); - if( ! $this->mod = 'html' ) { - $this->mod = 'tmce'; - } - ?> -
    - - -

    description ?>

    -
    - mod = strtolower( $this->mod ); + if ( ! 'html' === $this->mod ) { + $this->mod = 'tmce'; + } + ?> +
    + + +

    description ); ?>

    +
    + . */ -class coletivo_Alpha_Color_Control extends WP_Customize_Control { - - /** - * Official control name. - */ - public $type = 'alpha-color'; - - /** - * Add support for palettes to be passed in. - * - * Supported palette values are true, false, or an array of RGBa and Hex colors. - */ - public $palette; - - /** - * Add support for showing the opacity value on the slider handle. - */ - public $show_opacity; - - /** - * Enqueue scripts and styles. - * - * Ideally these would get registered and given proper paths before this control object - * gets initialized, then we could simply enqueue them here, but for completeness as a - * stand alone class we'll register and enqueue them here. - */ - public function enqueue() { - - } - - /** - * Render the control. - */ - public function render_content() { - - // Process the palette - if ( is_array( $this->palette ) ) { - $palette = implode( '|', $this->palette ); - } else { - // Default to true. - $palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true'; - } - - // Support passing show_opacity as string or boolean. Default to true. - $show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true'; - - // Begin the output. ?> - - palette ) ) { + $palette = implode( '|', $this->palette ); + } else { + // Default to true. + $palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true'; + } + + // Support passing show_opacity as string or boolean. Default to true. + $show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true'; + + // Begin the output. + ?> + + $op ) { - $args['fields'][ $key ]['id'] = $key; - if( ! isset( $op['value'] ) ) { - if( isset( $op['default'] ) ) { - $args['fields'][ $key ]['value'] = $op['default']; - } else { - $args['fields'][ $key ]['value'] = ''; - } - } - - } - - $this->fields = $args['fields']; - $this->live_title_id = isset( $args['live_title_id'] ) ? $args['live_title_id'] : false; - $this->defined_values = isset( $args['defined_values'] ) ? $args['defined_values'] : false; - $this->id_key = isset( $args['id_key'] ) ? $args['id_key'] : false; - if ( isset( $args['title_format'] ) && $args['title_format'] != '' ) { - $this->title_format = $args['title_format']; - } else { - $this->title_format = ''; - } - - if ( isset( $args['limited_msg'] ) && $args['limited_msg'] != '' ) { - $this->limited_msg = $args['limited_msg']; - } else { - $this->limited_msg = ''; - } - - if ( ! isset( $args['max_item'] ) ) { - $args['max_item'] = 0; - } - - if ( ! isset( $args['allow_unlimited'] ) || $args['allow_unlimited'] != false ) { - $this->max_item = apply_filters( 'coletivo_reepeatable_max_item', absint( $args['max_item'] ) ); - } else { - $this->max_item = absint( $args['max_item'] ); - } - - $this->changeable = isset( $args['changeable'] ) && $args['changeable'] == 'no' ? 'no' : 'yes'; - $this->default_empty_title = isset( $args['default_empty_title'] ) && $args['default_empty_title'] != '' ? $args['default_empty_title'] : esc_html__( 'Item', 'coletivo' ); - } - - public function merge_data( $array_value, $array_default ){ - - if ( ! $this->id_key ) { - return $array_value; - } - - if ( ! is_array( $array_value ) ) { - $array_value = array(); - } - - if ( ! is_array( $array_default ) ) { - $array_default = array(); - } - - $new_array = array(); - foreach ( $array_value as $k => $a ) { - - if ( is_array( $a ) ) { - if ( isset ( $a[ $this->id_key ] ) && $a[ $this->id_key ] != '' ) { - $new_array[ $a[ $this->id_key ] ] = $a; - } else { - $new_array[ $k ] = $a; - } - } - } - - foreach ( $array_default as $k => $a ) { - if ( is_array( $a ) && isset ( $a[ $this->id_key ] ) ) { - if ( ! isset ( $new_array[ $a[ $this->id_key ] ] ) ) { - $new_array[ $a[ $this->id_key ] ] = $a; - } - } - } - - return array_values( $new_array ); - } - - public function to_json() { - parent::to_json(); - $value = $this->value(); - - if (is_string( $value ) ) { - $value = json_decode( $value, true ); - } - if ( empty ( $value ) ){ - $value = $this->defined_values; - } elseif ( is_array( $this->defined_values ) && ! empty ( $this->defined_values ) ) { - $value = $this->merge_data( $value, $this->defined_values ); - } - - $this->json['live_title_id'] = $this->live_title_id; - $this->json['title_format'] = $this->title_format; - $this->json['max_item'] = $this->max_item; - $this->json['limited_msg'] = $this->limited_msg; - $this->json['changeable'] = $this->changeable; - $this->json['default_empty_title'] = $this->default_empty_title; - $this->json['value'] = $value; - $this->json['id_key'] = $this->id_key; - $this->json['fields'] = $this->fields; - - } - - /** - * Enqueue scripts/styles. - * - * @since 1.0.0 - * @access public - * @return void - */ - public function enqueue() { - add_action( 'customize_controls_print_footer_scripts', array( $this, 'item_tpl' ), 66 ); - } - - public function item_tpl(){ - ?> - - - - input_attrs(); ?> value="" link(); ?> /> -
    -
      -
      -
      - -
      - -
    • -
      -
      -
      - -
      -
      -

      -
      -
      - -
      -
      -
      - <# var cond_v; #> - <# for ( i in data ) { #> - <# if ( ! data.hasOwnProperty( i ) ) continue; #> - <# field = data[i]; #> - <# if ( ! field.type ) continue; #> - <# if ( field.type ){ #> - - <# - if ( field.required && field.required.length >= 3 ) { - #> -
      - <# - } else { - #> -
      - <# - } - #> - <# if ( field.type !== 'checkbox' ) { #> - <# if ( field.title ) { #> - - <# } #> - - <# if ( field.desc ) { #> -

      {{{ field.desc }}}

      - <# } #> - <# } #> - - <# if ( field.type === 'hidden' ) { #> - - <# } else if ( field.type === 'add_by' ) { #> - - <# } else if ( field.type === 'text' ) { #> - - <# } else if ( field.type === 'checkbox' ) { #> - - <# if ( field.title ) { #> - - <# } #> - - <# if ( field.desc ) { #> -

      {{ field.desc }}

      - <# } #> - - - <# } else if ( field.type === 'select' ) { #> - - <# if ( field.multiple ) { #> - - <# } #> - - <# for ( k in field.options ) { #> - <# if ( _.isArray( field.value ) ) { #> - - <# } else { #> - - <# } #> - <# } #> - - - - <# } else if ( field.type === 'radio' ) { #> - - <# for ( k in field.options ) { #> - - <# if ( field.options.hasOwnProperty( k ) ) { #> - - - - <# } #> - <# } #> - - <# } else if ( field.type == 'color' || field.type == 'coloralpha' ) { #> - - <# if ( field.value !='' ) { field.value = '#'+field.value ; } #> - - - - <# } else if ( field.type == 'media' ) { #> - - <# if ( !field.media || field.media == '' || field.media =='image' ) { #> - - <# } else { #> - - <# } #> - - - <# if ( !field.media || field.media == '' || field.media =='image' ) { #> -
      -
      -
      -
      - <# if ( field.value.url !== '' ){ #> - - <# } #> -
      -
      -
      -
      - <# } #> - -
      - - -
      -
      - - <# } else if ( field.type == 'textarea' || field.type == 'editor' ) { #> - - <# } else if ( field.type == 'icon' ) { #> - <# - var icon_class = field.value; - if ( icon_class.indexOf( 'fa-' ) != 0 ) { - icon_class = 'fa-' + field.value; - } else { - icon_class = icon_class.replace( 'fa ', '' ); - } - icon_class = icon_class.replace( 'fa-fa', '' ); - - #> -
      - - -
      - - <# } #> - -
      - - <# } #> - <# } #> -
      -
      - - - | - - -
      -
      -
      -
      -
      - -
      - -
      -
    • - $op ) { + $args['fields'][ $key ]['id'] = $key; + if ( ! isset( $op['value'] ) ) { + if ( isset( $op['default'] ) ) { + $args['fields'][ $key ]['value'] = $op['default']; + } else { + $args['fields'][ $key ]['value'] = ''; + } + } + } + + $this->fields = $args['fields']; + $this->live_title_id = isset( $args['live_title_id'] ) ? $args['live_title_id'] : false; + $this->defined_values = isset( $args['defined_values'] ) ? $args['defined_values'] : false; + $this->id_key = isset( $args['id_key'] ) ? $args['id_key'] : false; + if ( isset( $args['title_format'] ) && '' !== $args['title_format'] ) { + $this->title_format = $args['title_format']; + } else { + $this->title_format = ''; + } + + if ( isset( $args['limited_msg'] ) && '' !== $args['limited_msg'] ) { + $this->limited_msg = $args['limited_msg']; + } else { + $this->limited_msg = ''; + } + + if ( ! isset( $args['max_item'] ) ) { + $args['max_item'] = 0; + } + + if ( ! isset( $args['allow_unlimited'] ) || false !== $args['allow_unlimited'] ) { + $this->max_item = apply_filters( 'coletivo_reepeatable_max_item', absint( $args['max_item'] ) ); + } else { + $this->max_item = absint( $args['max_item'] ); + } + + $this->changeable = isset( $args['changeable'] ) && 'no' === $args['changeable'] ? 'no' : 'yes'; + $this->default_empty_title = isset( $args['default_empty_title'] ) && '' !== $args['default_empty_title'] ? $args['default_empty_title'] : esc_html__( 'Item', 'coletivo' ); + } + + /** + * Merge data + * + * @access public + * @param array $array_value Array value. + * @param array $array_default Array value. + * + * @return array + */ + public function merge_data( $array_value, $array_default ) { + + if ( ! $this->id_key ) { + return $array_value; + } + + if ( ! is_array( $array_value ) ) { + $array_value = array(); + } + + if ( ! is_array( $array_default ) ) { + $array_default = array(); + } + + $new_array = array(); + foreach ( $array_value as $k => $a ) { + + if ( is_array( $a ) ) { + if ( isset( $a[ $this->id_key ] ) && '' !== $a[ $this->id_key ] ) { + $new_array[ $a[ $this->id_key ] ] = $a; + } else { + $new_array[ $k ] = $a; + } + } + } + + foreach ( $array_default as $k => $a ) { + if ( is_array( $a ) && isset( $a[ $this->id_key ] ) ) { + if ( ! isset( $new_array[ $a[ $this->id_key ] ] ) ) { + $new_array[ $a[ $this->id_key ] ] = $a; + } + } + } + + return array_values( $new_array ); + } + + /** + * To JSON + * + * @access public + * + * @return void + */ + public function to_json() { + parent::to_json(); + $value = $this->value(); + + if ( is_string( $value ) ) { + $value = json_decode( $value, true ); + } + if ( empty( $value ) ) { + $value = $this->defined_values; + } elseif ( is_array( $this->defined_values ) && ! empty( $this->defined_values ) ) { + $value = $this->merge_data( $value, $this->defined_values ); + } + + $this->json['live_title_id'] = $this->live_title_id; + $this->json['title_format'] = $this->title_format; + $this->json['max_item'] = $this->max_item; + $this->json['limited_msg'] = $this->limited_msg; + $this->json['changeable'] = $this->changeable; + $this->json['default_empty_title'] = $this->default_empty_title; + $this->json['value'] = $value; + $this->json['id_key'] = $this->id_key; + $this->json['fields'] = $this->fields; + } + + /** + * Enqueue scripts/styles. + * + * @since 1.0.0 + * @access public + * + * @return void + */ + public function enqueue() { + add_action( 'customize_controls_print_footer_scripts', array( $this, 'item_tpl' ), 66 ); + } + + /** + * Item TPL + * + * @access public + * + * @return void + */ + public function item_tpl() { + ?> + + + + input_attrs(); ?> value="" link(); ?> /> +
      +
        +
        +
        + +
        + +
      • +
        +
        +
        + +
        +
        +

        +
        +
        + +
        +
        +
        + <# var cond_v; #> + <# for ( i in data ) { #> + <# if ( ! data.hasOwnProperty( i ) ) continue; #> + <# field = data[i]; #> + <# if ( ! field.type ) continue; #> + <# if ( field.type ){ #> + + <# + if ( field.required && field.required.length >= 3 ) { + #> +
        + <# + } else { + #> +
        + <# + } + #> + <# if ( 'checkbox' !== field.type ) { #> + <# if ( field.title ) { #> + + <# } #> + + <# if ( field.desc ) { #> +

        {{{ field.desc }}}

        + <# } #> + <# } #> + + <# if ( 'hidden' === field.type ) { #> + + <# } else if ( 'add_by' === field.type ) { #> + + <# } else if ( 'text' === field.type ) { #> + + <# } else if ( 'checkbox' === field.type ) { #> + + <# if ( field.title ) { #> + + <# } #> + + <# if ( field.desc ) { #> +

        {{ field.desc }}

        + <# } #> + + + <# } else if ( 'select' === field.type ) { #> + + <# if ( field.multiple ) { #> + + <# } #> + + <# for ( k in field.options ) { #> + <# if ( _.isArray( field.value ) ) { #> + + <# } else { #> + + <# } #> + <# } #> + + + <# } else if ( 'radio' === field.type ) { #> + + <# for ( k in field.options ) { #> + + <# if ( field.options.hasOwnProperty( k ) ) { #> + + + + <# } #> + <# } #> + + <# } else if ( 'color' === field.type || 'coloralpha' === field.type ) { #> + + <# if ( '' !== field.value ) { field.value = '#'+field.value ; } #> + + + + <# } else if ( 'media' === field.type ) { #> + + <# if ( ! field.media || '' === field.media || 'image' === field.media ) { #> + + <# } else { #> + + <# } #> + + + <# if ( ! field.media || '' === field.media || 'image' === field.media ) { #> +
        +
        +
        +
        + <# if ( '' !== field.value.url ){ #> + + <# } #> +
        +
        +
        +
        + <# } #> + +
        + + +
        +
        + + <# } else if ( 'textarea' === field.type || 'editor' === field.type ) { #> + + <# } else if ( 'icon' === field.type ) { #> + <# + var icon_class = field.value; + if ( 0 !== icon_class.indexOf( 'fa-' ) ) { + icon_class = 'fa-' + field.value; + } else { + icon_class = icon_class.replace( 'fa ', '' ); + } + icon_class = icon_class.replace( 'fa-fa', '' ); + + #> +
        + + +
        + + <# } #> + +
        + + <# } #> + <# } #> +
        +
        + + + | + + +
        +
        +
        +
        +
        + +
        + +
        +
      • + - - + + - - + + __( 'Section: ', 'coletivo' ) ) ); +/** + * Customizer control scripts + * + * @return void + */ +function coletivo_customizer_control_scripts() { + wp_enqueue_media(); + wp_enqueue_script( 'jquery-ui-sortable' ); + wp_enqueue_script( 'wp-color-picker' ); + wp_enqueue_style( 'wp-color-picker' ); + + wp_enqueue_script( 'coletivo-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-controls', 'wp-color-picker' ), VERSION, true ); + wp_enqueue_style( 'coletivo-customizer', get_template_directory_uri() . '/assets/css/customizer.css', false, VERSION ); + wp_localize_script( 'coletivo-customizer', 'coletivo_customizer', array( 'before_section_title' => __( 'Section: ', 'coletivo' ) ) ); } -add_action( 'customize_controls_enqueue_scripts', 'onepres_customizer_control_scripts', 99 ); +add_action( 'customize_controls_enqueue_scripts', 'coletivo_customizer_control_scripts', 99 ); add_action( 'customize_controls_enqueue_scripts', array( 'coletivo_Editor_Scripts', 'enqueue' ), 95 ); - diff --git a/inc/customizer-selective-refresh.php b/inc/customizer-selective-refresh.php index 414c674..e565b61 100644 --- a/inc/customizer-selective-refresh.php +++ b/inc/customizer-selective-refresh.php @@ -1,305 +1,345 @@ -selective_refresh ) ) { - return; - } - - $selective_refresh_keys = array( - - // section hero - array( - 'id' => 'hero', - 'selector' => '.hero-slideshow-wrapper', - 'settings' => array( - 'coletivo_hero_images', - ), - ), - - // section features - array( - 'id' => 'features', - 'selector' => '.section-features', - 'settings' => array( - 'coletivo_features_boxes', - 'coletivo_features_title', - 'coletivo_features_subtitle', - 'coletivo_features_desc', - 'coletivo_features_layout', - ), - ), - - // section yourslider - array( - 'id' => 'yourslider', - 'selector' => '.section-yourslider', - 'settings' => array( - 'coletivo_yourslider_shortcode', - ), - ), - - // section services - array( - 'id' => 'services', - 'selector' => '.section-services', - 'settings' => array( - 'coletivo_services', - 'coletivo_services_title', - 'coletivo_services_subtitle', - 'coletivo_services_desc', - 'coletivo_service_layout', - ), - ), - - // section portfolio - array( - 'id' => 'portfolio', - 'selector' => '.section-portfolio', - 'settings' => array( - 'coletivo_portfolio_title', - 'coletivo_portfolio_subtitle', - 'coletivo_portfolio_desc', - 'coletivo_portfolio_number', - 'coletivo_portfolio_more_link', - 'coletivo_portfolio_more_text', - ), - ), - - // section news - array( - 'id' => 'news', - 'selector' => '.section-news', - 'settings' => array( - 'coletivo_news_title', - 'coletivo_news_subtitle', - 'coletivo_news_desc', - 'coletivo_news_number', - 'coletivo_news_more_link', - 'coletivo_news_more_text', - ), - ), - - // section featuredpage - array( - 'id' => 'featuredpage', - 'selector' => '.section-featuredpage', - 'settings' => array( - 'coletivo_featuredpage_overlay_color', - ), - ), - - // section contact - array( - 'id' => 'contact', - 'selector' => '.section-contact', - 'settings' => array( - 'coletivo_contact_title', - 'coletivo_contact_subtitle', - 'coletivo_contact_desc', - 'coletivo_contact_cf7', - 'coletivo_contact_cf7_disable', - 'coletivo_contact_text', - 'coletivo_contact_address_title', - 'coletivo_contact_address', - 'coletivo_contact_phone', - 'coletivo_contact_email', - 'coletivo_contact_fb', - 'coletivo_contact_instagram', - 'coletivo_contact_twitter', - ), - ), - - // section videolightbox - array( - 'id' => 'videolightbox', - 'selector' => '.section-videolightbox', - 'settings' => array( - 'coletivo_videolightbox_title', - 'coletivo_videolightbox_url', - ), - ), - - // section gallery - 'gallery' => array( - 'id' => 'gallery', - 'selector' => '.section-gallery', - 'settings' => array( - 'coletivo_gallery_source_page', - 'coletivo_gallery_layout', - 'coletivo_gallery_display', - 'coletivo_g_number', - 'coletivo_g_row_height', - 'coletivo_g_col', - 'coletivo_g_readmore_link', - 'coletivo_g_readmore_text', - 'coletivo_gallery_title', - 'coletivo_gallery_subtitle', - 'coletivo_gallery_desc', - ), - ), - - // section team - array( - 'id' => 'team', - 'selector' => '.section-team', - 'settings' => array( - 'coletivo_team_members', - 'coletivo_team_title', - 'coletivo_team_subtitle', - 'coletivo_team_desc', - 'coletivo_team_layout', - ), - ), - - // section social - array( - 'id' => 'social', - 'selector' => '.section-social', - 'settings' => array( - 'coletivo_social_footer_title', - 'coletivo_footer_bg', - 'coletivo_social_profiles', - ), - ), - - ); - - $selective_refresh_keys = apply_filters( 'coletivo_customizer_partials_selective_refresh_keys', $selective_refresh_keys ); - - foreach ( $selective_refresh_keys as $section ) { - foreach ( $section['settings'] as $key ) { - if ( $wp_customize->get_setting( $key ) ) { - $wp_customize->get_setting( $key )->transport = 'postMessage'; - } - } - - $wp_customize->selective_refresh->add_partial( 'section-'.$section['id'] , array( - 'selector' => $section['selector'], - 'settings' => $section['settings'], - 'render_callback' => 'coletivo_selective_refresh_render_section_content', - )); - } - // Logo, description and favicon - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; - $wp_customize->get_setting( 'coletivo_hide_sitetitle' )->transport = 'postMessage'; - $wp_customize->get_setting( 'coletivo_hide_tagline' )->transport = 'postMessage'; - $wp_customize->selective_refresh->add_partial( 'header_brand', array( - 'selector' => '.site-header .site-branding', - 'settings' => array( 'blogname', 'blogdescription', 'coletivo_hide_sitetitle', 'coletivo_hide_tagline' ), - 'render_callback' => 'coletivo_site_logo', - ) ); - - // Social heading - $wp_customize->selective_refresh->add_partial( 'coletivo_social_footer_title', array( - 'selector' => '', - 'settings' => array( 'coletivo_social_footer_title' ), - 'render_callback' => 'coletivo_selective_refresh_social_footer_title', - ) ); - - // Featured Page Content - $wp_customize->selective_refresh->add_partial( 'coletivo_featuredpage_content_source', array( - 'selector' => '.section-featuredpage', - 'settings' => array( 'coletivo_featuredpage_content_source', 'coletivo_featuredpage_more_text' ), - 'render_callback' => 'coletivo_selective_refresh_featuredpage', - ) ); - - // Featured Page Background - $wp_customize->selective_refresh->add_partial( 'coletivo_featuredpage_overlay_color', array( - 'selector' => '.section-featuredpage:before', - 'settings' => array( 'coletivo_featuredpage_overlay_color' ), - 'render_callback' => 'coletivo_selective_refresh_featuredpage', - ) ); - -} -add_action( 'customize_register', 'coletivo_customizer_partials', 50 ); - - - -/** - * Selective render content - * - * @param $partial - * @param array $container_context - */ -function coletivo_selective_refresh_render_section_content( $partial, $container_context = array() ) { - $tpl = 'section-parts/'.$partial->id.'.php'; - $GLOBALS['coletivo_is_selective_refresh'] = true; - $file = coletivo_customizer_load_template( $tpl ); - if ( $file ) { - include $file; - } -} - -function coletivo_selective_refresh_social_footer_title(){ - return get_theme_mod( 'coletivo_social_footer_title' ); -} - -function coletivo_selective_refresh_featured_page( $partial = '', $container_context = '') { - return coletivo_get_customizer_section_content( array( ' - section-parts/section-featuredpage.php' ), array() ); -} \ No newline at end of file +selective_refresh ) ) { + return; + } + + $selective_refresh_keys = array( + + // section hero. + array( + 'id' => 'hero', + 'selector' => '.hero-slideshow-wrapper', + 'settings' => array( + 'coletivo_hero_images', + ), + ), + + // section features. + array( + 'id' => 'features', + 'selector' => '.section-features', + 'settings' => array( + 'coletivo_features_boxes', + 'coletivo_features_title', + 'coletivo_features_subtitle', + 'coletivo_features_desc', + 'coletivo_features_layout', + ), + ), + + // section yourslider. + array( + 'id' => 'yourslider', + 'selector' => '.section-yourslider', + 'settings' => array( + 'coletivo_yourslider_shortcode', + ), + ), + + // section services. + array( + 'id' => 'services', + 'selector' => '.section-services', + 'settings' => array( + 'coletivo_services', + 'coletivo_services_title', + 'coletivo_services_subtitle', + 'coletivo_services_desc', + 'coletivo_service_layout', + ), + ), + + // section portfolio. + array( + 'id' => 'portfolio', + 'selector' => '.section-portfolio', + 'settings' => array( + 'coletivo_portfolio_title', + 'coletivo_portfolio_subtitle', + 'coletivo_portfolio_desc', + 'coletivo_portfolio_number', + 'coletivo_portfolio_more_link', + 'coletivo_portfolio_more_text', + ), + ), + + // section news. + array( + 'id' => 'news', + 'selector' => '.section-news', + 'settings' => array( + 'coletivo_news_title', + 'coletivo_news_subtitle', + 'coletivo_news_desc', + 'coletivo_news_number', + 'coletivo_news_more_link', + 'coletivo_news_more_text', + ), + ), + + // section featuredpage. + array( + 'id' => 'featuredpage', + 'selector' => '.section-featuredpage', + 'settings' => array( + 'coletivo_featuredpage_overlay_color', + ), + ), + + // section contact. + array( + 'id' => 'contact', + 'selector' => '.section-contact', + 'settings' => array( + 'coletivo_contact_title', + 'coletivo_contact_subtitle', + 'coletivo_contact_desc', + 'coletivo_contact_cf7', + 'coletivo_contact_cf7_disable', + 'coletivo_contact_text', + 'coletivo_contact_address_title', + 'coletivo_contact_address', + 'coletivo_contact_phone', + 'coletivo_contact_email', + 'coletivo_contact_fb', + 'coletivo_contact_instagram', + 'coletivo_contact_twitter', + ), + ), + + // section videolightbox. + array( + 'id' => 'videolightbox', + 'selector' => '.section-videolightbox', + 'settings' => array( + 'coletivo_videolightbox_title', + 'coletivo_videolightbox_url', + ), + ), + + // section gallery. + 'gallery' => array( + 'id' => 'gallery', + 'selector' => '.section-gallery', + 'settings' => array( + 'coletivo_gallery_source_page', + 'coletivo_gallery_layout', + 'coletivo_gallery_display', + 'coletivo_g_number', + 'coletivo_g_row_height', + 'coletivo_g_col', + 'coletivo_g_readmore_link', + 'coletivo_g_readmore_text', + 'coletivo_gallery_title', + 'coletivo_gallery_subtitle', + 'coletivo_gallery_desc', + ), + ), + + // section team. + array( + 'id' => 'team', + 'selector' => '.section-team', + 'settings' => array( + 'coletivo_team_members', + 'coletivo_team_title', + 'coletivo_team_subtitle', + 'coletivo_team_desc', + 'coletivo_team_layout', + ), + ), + + // section social. + array( + 'id' => 'social', + 'selector' => '.section-social', + 'settings' => array( + 'coletivo_social_footer_title', + 'coletivo_footer_bg', + 'coletivo_social_profiles', + ), + ), + + ); + + $selective_refresh_keys = apply_filters( 'coletivo_customizer_partials_selective_refresh_keys', $selective_refresh_keys ); + + foreach ( $selective_refresh_keys as $section ) { + foreach ( $section['settings'] as $key ) { + if ( $wp_customize->get_setting( $key ) ) { + $wp_customize->get_setting( $key )->transport = 'postMessage'; + } + } + + $wp_customize->selective_refresh->add_partial( + 'section-' . $section['id'], + array( + 'selector' => $section['selector'], + 'settings' => $section['settings'], + 'render_callback' => 'coletivo_selective_refresh_render_section_content', + ) + ); + } + + // Logo, description and favicon. + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'coletivo_hide_sitetitle' )->transport = 'postMessage'; + $wp_customize->get_setting( 'coletivo_hide_tagline' )->transport = 'postMessage'; + $wp_customize->selective_refresh->add_partial( + 'header_brand', + array( + 'selector' => '.site-header .site-branding', + 'settings' => array( 'blogname', 'blogdescription', 'coletivo_hide_sitetitle', 'coletivo_hide_tagline' ), + 'render_callback' => 'coletivo_site_logo', + ) + ); + + // Social heading. + $wp_customize->selective_refresh->add_partial( + 'coletivo_social_footer_title', + array( + 'selector' => '', + 'settings' => array( 'coletivo_social_footer_title' ), + 'render_callback' => 'coletivo_selective_refresh_social_footer_title', + ) + ); + + // Featured Page Content. + $wp_customize->selective_refresh->add_partial( + 'coletivo_featuredpage_content_source', + array( + 'selector' => '.section-featuredpage', + 'settings' => array( 'coletivo_featuredpage_content_source', 'coletivo_featuredpage_more_text' ), + 'render_callback' => 'coletivo_selective_refresh_featuredpage', + ) + ); + + // Featured Page Background. + $wp_customize->selective_refresh->add_partial( + 'coletivo_featuredpage_overlay_color', + array( + 'selector' => '.section-featuredpage:before', + 'settings' => array( 'coletivo_featuredpage_overlay_color' ), + 'render_callback' => 'coletivo_selective_refresh_featuredpage', + ) + ); + +} +add_action( 'customize_register', 'coletivo_customizer_partials', 50 ); + +/** + * Selective render content + * + * @param Object|int $partial The partial section. + * @param array $container_context Container array. + */ +function coletivo_selective_refresh_render_section_content( $partial, $container_context = array() ) { + $tpl = 'section-parts/' . $partial->id . '.php'; + + $GLOBALS['coletivo_is_selective_refresh'] = true; + + $file = coletivo_customizer_load_template( $tpl ); + + if ( $file ) { + include $file; + } +} + +/** + * Selective refresh social footer title + */ +function coletivo_selective_refresh_social_footer_title() { + return get_theme_mod( 'coletivo_social_footer_title' ); +} + +/** + * Selective refresh featured page + * + * @param Object|int $partial The partial section. + * @param array $container_context Container array. + */ +function coletivo_selective_refresh_featured_page( $partial = '', $container_context = '' ) { + return coletivo_get_customizer_section_content( + array( + 'section-parts/section-featuredpage.php', + ), + array() + ); +} diff --git a/inc/customizer-update-fields.php b/inc/customizer-update-fields.php index b6422fb..8bb8150 100644 --- a/inc/customizer-update-fields.php +++ b/inc/customizer-update-fields.php @@ -1,11 +1,12 @@ - * @license GPL-2.0+ - * @copyright 2017 Matheus Gimenez + * @package Coletivo + * @subpackage WP_Update_Customizer + * @author Matheus Gimenez + * @license GPL-2.0+ + * @copyright 2017 Matheus Gimenez * * @wordpress-plugin * Description: ColetivoWP_Update_Customizer @@ -18,8 +19,11 @@ */ // If this file is called directly, abort. -if ( ! defined( 'ABSPATH' ) ) exit; +defined( 'ABSPATH' ) || exit; +/** + * Coletivo Update Customizer class + */ class ColetivoWP_Update_Customizer { /** * @@ -30,26 +34,27 @@ public function __construct() { } /** * Change "onepress" to "coletivo" in customizer fields + * * @return type */ public function update_theme_mod() { if ( 'true' === get_option( 'tema_coletivo_updated_customizer', 'false' ) ) { return; } - $customizer_fields = get_option( 'theme_mods_tema-coletivo' ); + $customizer_fields = get_option( 'theme_mods_coletivo' ); if ( is_array( $customizer_fields ) ) { foreach ( $customizer_fields as $key => $value ) { if ( false === strpos( $key, 'onepress' ) ) { continue; - } - $new_key = str_replace( 'onepress', 'coletivo', $key ); + } + $new_key = str_replace( 'onepress', 'coletivo', $key ); $customizer_fields[ $new_key ] = $value; unset( $customizer_fields[ $key ] ); } - update_option( 'theme_mods_tema-coletivo', $customizer_fields ); + update_option( 'theme_mods_coletivo', $customizer_fields ); update_option( 'tema_coletivo_updated_customizer', 'true' ); } } } -new ColetivoWP_Update_Customizer(); \ No newline at end of file +new ColetivoWP_Update_Customizer(); From 1b6987a26bf4f271669c47d559570d7088fe1728 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Thu, 6 May 2021 23:38:02 -0300 Subject: [PATCH 07/32] Coding standards em arquivos da pasta inc - dashboard.php; - extras.php; - template-tags.php. --- inc/dashboard.php | 19 +- inc/extras.php | 303 ++++++++------- inc/template-tags.php | 849 ++++++++++++++++++++++-------------------- 3 files changed, 622 insertions(+), 549 deletions(-) diff --git a/inc/dashboard.php b/inc/dashboard.php index ba9b2ae..22f41f6 100644 --- a/inc/dashboard.php +++ b/inc/dashboard.php @@ -50,7 +50,7 @@ function coletivo_admin_notice() { $theme_data = wp_get_theme(); ?>
        -

        Welcome page', 'coletivo' ), esc_html( $theme_data->Name ), esc_url( admin_url( 'themes.php?page=ft_coletivo' ) ) ); ?>

        +

        Welcome page', 'coletivo' ), esc_html( $theme_data->Name ), esc_url( admin_url( 'themes.php?page=ft_coletivo' ) ) ); // phpcs:ignore ?>

        -

        Version ) ); ?>

        +

        Version ) ); // phpcs:ignore ?>

        ColetivoWP '; ?> - ' . esc_html($coletivo_contact_title) . ''; ?> - ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; - } ?> -
        - -
        - -
        - -
        - - -
        -

        -
        -
        -
        - - -
        - - -
        -
        - - - -
        - - -
        -
        - - - -
        - - -
        - - -
        + $desc = get_theme_mod( 'coletivo_contact_desc' ); + + if ( ! $coletivo_contact_disable ) { + if ( ! coletivo_is_selective_refresh() ) { + ?> +
        class=""> + +
        + +
        + ' . esc_html( $coletivo_contact_subtitle ) . ''; + } + + if ( '' !== $coletivo_contact_title ) { + echo '

        ' . esc_html( $coletivo_contact_title ) . '

        '; + } + + if ( $desc ) { + echo '
        ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; // phpcs:ignore + } + ?> +
        + +
        + +
        + +
        + + +
        +

        + +

        +
        + +
        +
        + +
        + + +
        +
        + + + +
        + + +
        +
        + + + +
        + + +
        + +
        - - - -
        - - -
        -
        - - - -
        - - -
        -
        - - - -
        - - -
        -
        - - - -
        - - -
        -
        - - -
        -
        - - -
        -
        - - -
        - - + + + +
        + + +
        +
        + + + +
        + + +
        +
        + + + +
        + + +
        +
        + + + +
        + + +
        +
        + +
        +
        +
        +
        + + + + - - - - - -
        class=""> - - -
        -
        - -
        -

        -
        - + + -
        -
        - - - - - -
        - -
        -
        - - -
        - +
        class=""> + + +
        +
        + +
        +

        +
        + +
        +
        + + + + + +
        + +
        +
        + + +
        + - -
        - class=""> - - -
        - -
        - ' . esc_html($subtitle) . ''; ?> - ' . esc_html($title) . ''; ?> - ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; - } ?> -
        - -
        -
        - $f ) { - $media = ''; - $f = wp_parse_args( $f, array( - 'icon_type' => 'icon', - 'icon' => 'gg', - 'image' => '', - 'link' => '', - 'title' => '', - 'desc' => '', - ) ); - if ( $f['icon_type'] == 'image' && $f['image'] ){ - $url = coletivo_get_media_url( $f['image'] ); - if ( $url ) { - $media = ''; - } - } else if ( $f['icon'] ) { - $f['icon'] = trim( $f['icon'] ); - $media = ' '; - } +$data = coletivo_get_section_features_data(); +if ( ! $disable && ! empty( $data ) ) { + $coletivo_featureds_desc = get_theme_mod( 'coletivo_features_desc' ); + + ?> + +
        + class=""> + + +
        + +
        + ' . esc_html( $coletivo_featureds_subtitle ) . ''; + } - ?> -
        -
        - - - -
        -

        -
        -
        - ' . esc_html( $coletivo_featureds_title ) . ''; + } - ?> -
        -
        -
        - + if ( $coletivo_featureds_desc ) { + echo '
        ' . apply_filters( 'the_content', wp_kses_post( $coletivo_featureds_desc ) ) . '
        '; // phpcs:ignore + } + ?> +
        + +
        +
        + $f ) { + $media = ''; + $f = wp_parse_args( + $f, + array( + 'icon_type' => 'icon', + 'icon' => 'gg', + 'image' => '', + 'link' => '', + 'title' => '', + 'desc' => '', + ) + ); + if ( 'image' === $f['icon_type'] && $f['image'] ) { + $url = coletivo_get_media_url( $f['image'] ); + if ( $url ) { + $media = ''; + } + } elseif ( $f['icon'] ) { + $f['icon'] = trim( $f['icon'] ); + $media = ' '; + } + ?> +
        +
        + + + + + + + +
        +

        + + + + + + + +

        +
        +
        + +
        +
        +
        + - - - - \ No newline at end of file + + + Date: Sat, 8 May 2021 11:16:36 -0300 Subject: [PATCH 09/32] =?UTF-8?q?Altera=C3=A7=C3=B5es=20m=C3=ADnimas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- section-parts/section-features.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/section-parts/section-features.php b/section-parts/section-features.php index 542d412..5629110 100644 --- a/section-parts/section-features.php +++ b/section-parts/section-features.php @@ -5,37 +5,37 @@ * @package coletivo */ -$coletivo_featureds_id = get_theme_mod( 'coletivo_features_id', esc_html__( 'features', 'coletivo' ) ); -$coletivo_featureds_disable = get_theme_mod( 'coletivo_features_disable' ) === 1 ? true : false; -$coletivo_featureds_title = get_theme_mod( 'coletivo_features_title', esc_html__( 'Features', 'coletivo' ) ); -$coletivo_featureds_subtitle = get_theme_mod( 'coletivo_features_subtitle', esc_html__( 'Why choose Us', 'coletivo' ) ); +$coletivo_features_id = get_theme_mod( 'coletivo_features_id', esc_html__( 'features', 'coletivo' ) ); +$coletivo_features_disable = get_theme_mod( 'coletivo_features_disable' ) === 1 ? true : false; +$coletivo_features_title = get_theme_mod( 'coletivo_features_title', esc_html__( 'Features', 'coletivo' ) ); +$coletivo_features_subtitle = get_theme_mod( 'coletivo_features_subtitle', esc_html__( 'Why choose Us', 'coletivo' ) ); if ( coletivo_is_selective_refresh() ) { $disable = false; } $data = coletivo_get_section_features_data(); if ( ! $disable && ! empty( $data ) ) { - $coletivo_featureds_desc = get_theme_mod( 'coletivo_features_desc' ); + $coletivo_features_desc = get_theme_mod( 'coletivo_features_desc' ); ?> -
        +
        class="">
        - +
        ' . esc_html( $coletivo_featureds_subtitle ) . ''; + if ( '' !== $coletivo_features_subtitle ) { + echo '
        ' . esc_html( $coletivo_features_subtitle ) . '
        '; } - if ( '' !== $coletivo_featureds_title ) { - echo '

        ' . esc_html( $coletivo_featureds_title ) . '

        '; + if ( '' !== $coletivo_features_title ) { + echo '

        ' . esc_html( $coletivo_features_title ) . '

        '; } - if ( $coletivo_featureds_desc ) { - echo '
        ' . apply_filters( 'the_content', wp_kses_post( $coletivo_featureds_desc ) ) . '
        '; // phpcs:ignore + if ( $coletivo_features_desc ) { + echo '
        ' . apply_filters( 'the_content', wp_kses_post( $coletivo_features_desc ) ) . '
        '; // phpcs:ignore } ?>
        From b6b303a3a723bdcfc3f2115d99df9b6b7604a890 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sat, 8 May 2021 12:12:05 -0300 Subject: [PATCH 10/32] =?UTF-8?q?Fix:=20Corer=C3=A7=C3=A3o=20de=20nome=20d?= =?UTF-8?q?e=20vari=C3=A1vel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- section-parts/section-features.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/section-parts/section-features.php b/section-parts/section-features.php index 5629110..eeef103 100644 --- a/section-parts/section-features.php +++ b/section-parts/section-features.php @@ -10,10 +10,10 @@ $coletivo_features_title = get_theme_mod( 'coletivo_features_title', esc_html__( 'Features', 'coletivo' ) ); $coletivo_features_subtitle = get_theme_mod( 'coletivo_features_subtitle', esc_html__( 'Why choose Us', 'coletivo' ) ); if ( coletivo_is_selective_refresh() ) { - $disable = false; + $coletivo_features_disable = false; } $data = coletivo_get_section_features_data(); -if ( ! $disable && ! empty( $data ) ) { +if ( ! $coletivo_features_disable && ! empty( $data ) ) { $coletivo_features_desc = get_theme_mod( 'coletivo_features_desc' ); ?> From ac335e8b77a5b3fafa115b3a0ac48c21085b70c2 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sat, 8 May 2021 12:43:45 -0300 Subject: [PATCH 11/32] Coding standards (pasta section-parts) - section-gallery.php; - section-hero.php; - section-news.php. --- section-parts/section-gallery.php | 118 ++++++++++++++------------ section-parts/section-hero.php | 134 +++++++++++++++++++----------- section-parts/section-news.php | 129 +++++++++++++++++----------- 3 files changed, 233 insertions(+), 148 deletions(-) diff --git a/section-parts/section-gallery.php b/section-parts/section-gallery.php index 6aa0899..bada73f 100644 --- a/section-parts/section-gallery.php +++ b/section-parts/section-gallery.php @@ -1,51 +1,67 @@ - - - -
        - class=""> - - -
        - -
        - ' . esc_html($subtitle) . ''; ?> - ' . esc_html($title) . ''; ?> - ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; - } ?> -
        - - - - - - -
        - - -
        - - + + + + '')); - $_u = coletivo_get_media_url($m['image']); +foreach ( $_images as $m ) { // phpcs:ignore + $m = wp_parse_args( $m, array( 'image' => '' ) ); // phpcs:ignore + $_u = coletivo_get_media_url( $m['image'] ); if ( $_u ) { $images[] = $_u; } } -if ( empty( $images ) ){ - $images = array( get_template_directory_uri().'/assets/images/coletivo1.jpg' ); +if ( empty( $images ) ) { + $images = array( get_template_directory_uri() . '/assets/images/coletivo1.jpg' ); } -$is_parallax = get_theme_mod( 'coletivo_hero_parallax' ) == 1 && ! empty( $images ) ; +$is_parallax = get_theme_mod( 'coletivo_hero_parallax' ) === 1 && ! empty( $images ); if ( $is_parallax ) { - echo '
        '; + echo '
        '; } ?> - -
        + " class="hero-slideshow-wrapper + "> + echo ' hero-slideshow-normal'; + } + ?> + "> Business Website'."\n".'Made Simple.'."\n".'We provide creative solutions to clients around the world,'."\n".'creating things that get attention and meaningful.'."\n\n".'Get Started' ) ); - $hcl2_image = get_theme_mod( 'coletivo_hcl2_image', get_template_directory_uri().'/assets/images/onepress_responsive.png' ); + $hcl2_content = get_theme_mod( 'coletivo_hcl2_content', wp_kses_post( '

        Business Website' . "\n" . 'Made Simple.

        ' . "\n" . 'We provide creative solutions to clients around the world,' . "\n" . 'creating things that get attention and meaningful. ' . "\n\n" . 'Get Started' ) ); + $hcl2_image = get_theme_mod( 'coletivo_hcl2_image', get_template_directory_uri() . '/assets/images/onepress_responsive.png' ); ?> -
        > +
        >
        - '.apply_filters( 'the_content', wp_kses_post( $hcl2_content ) ).'
        ' ; }; ?> + ' .apply_filters( 'the_content', wp_kses_post( $hcl2_content ) ). '
        '; // phpcs:ignore + } + ?>
        - ' ; }; ?> + '; + } + ?>
        Free | Responsive | Perfect', 'coletivo' )); - $hcl1_smalltext = get_theme_mod( 'coletivo_hcl1_smalltext', wp_kses_post('Morbi tempus porta nunc pharetra quisque ligula imperdiet posuere
        vitae felis proin sagittis leo ac tellus blandit sollicitudin quisque vitae placerat.', 'coletivo') ); - $hcl1_btn1_text = get_theme_mod( 'coletivo_hcl1_btn1_text', esc_html__('Our Services', 'coletivo') ); - $hcl1_btn1_link = get_theme_mod( 'coletivo_hcl1_btn1_link', esc_url( home_url( '/' )).esc_html__('#services', 'coletivo') ); - $hcl1_btn2_text = get_theme_mod( 'coletivo_hcl1_btn2_text', esc_html__('Get Started', 'coletivo') ); - $hcl1_btn2_link = get_theme_mod( 'coletivo_hcl1_btn2_link', esc_url( home_url( '/' )).esc_html__('#contact', 'coletivo') ); - - $btn_1_style = get_theme_mod( 'coletivo_hcl1_btn1_style', 'btn-theme-primary' ); - $btn_2_style = get_theme_mod( 'coletivo_hcl1_btn2_style', 'btn-secondary-outline' ); + $hcl1_largetext = get_theme_mod( 'coletivo_hcl1_largetext', wp_kses_post( 'We are WordPress Free | Responsive | Perfect', 'coletivo' ) ); + $hcl1_smalltext = get_theme_mod( 'coletivo_hcl1_smalltext', wp_kses_post( 'Morbi tempus porta nunc pharetra quisque ligula imperdiet posuere
        vitae felis proin sagittis leo ac tellus blandit sollicitudin quisque vitae placerat. ', 'coletivo' ) ); + $hcl1_btn1_text = get_theme_mod( 'coletivo_hcl1_btn1_text', esc_html__( 'Our Services', 'coletivo' ) ); + $hcl1_btn1_link = get_theme_mod( 'coletivo_hcl1_btn1_link', esc_url( home_url( '/' ) ) . esc_html__( '#services', 'coletivo' ) ); + $hcl1_btn2_text = get_theme_mod( 'coletivo_hcl1_btn2_text', esc_html__( 'Get Started', 'coletivo' ) ); + $hcl1_btn2_link = get_theme_mod( 'coletivo_hcl1_btn2_link', esc_url( home_url( '/' ) ) . esc_html__( '#contact', 'coletivo' ) ); + + $btn_1_style = get_theme_mod( 'coletivo_hcl1_btn1_style', 'btn-theme-primary' ); + $btn_2_style = get_theme_mod( 'coletivo_hcl1_btn2_style', 'btn-secondary-outline' ); ?> -
        > +
        >
        - ' . wp_kses_post($hcl1_largetext) . ''; ?> - ' . wp_kses_post( $hcl1_smalltext ) . '

        ' ?> - ' . wp_kses_post($hcl1_btn1_text) . ''; ?> - ' . wp_kses_post($hcl1_btn2_text) . ''; ?> + ' . wp_kses_post( $hcl1_largetext ) . ''; + } + + if ( '' !== $hcl1_smalltext ) { + echo '

        ' . wp_kses_post( $hcl1_smalltext ) . '

        '; + } + + if ( '' !== $hcl1_btn1_text && '' !== $hcl1_btn1_link ) { + echo '' . wp_kses_post( $hcl1_btn1_text ) . ''; + } + + if ( '' !== $hcl1_btn2_text && '' !== $hcl1_btn2_link ) { + echo '' . wp_kses_post( $hcl1_btn2_text ) . ''; + } + ?>
        + ?>
        -'; // end parallax + echo '
        '; // end parallax. } diff --git a/section-parts/section-news.php b/section-parts/section-news.php index 00cf535..493d645 100644 --- a/section-parts/section-news.php +++ b/section-parts/section-news.php @@ -1,32 +1,56 @@ - - -
        class=""> - - + if ( ! coletivo_is_selective_refresh() ) { + ?> +
        class=""> +
        - -
        - ' . esc_html( $coletivo_news_subtitle ) . ''; ?> - ' . esc_html( $coletivo_news_title ) . ''; ?> - ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; - } ?> -
        + +
        + ' . esc_html( $coletivo_news_subtitle ) . ''; + } + + if ( '' !== $coletivo_news_title ) { + echo '

        ' . esc_html( $coletivo_news_title ) . '

        '; + } + + if ( $desc ) { + echo '
        ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; // phpcs:ignore + } + ?> +
        @@ -35,33 +59,38 @@ $coletivo_news_number, + 'posts_per_page' => $coletivo_news_number, 'suppress_filters' => 0, ) ); - ?> - have_posts() ) : ?> - - have_posts() ) : $query->the_post(); ?> - + if ( $query->have_posts() ) { + /* Start the Loop */ + while ( $query->have_posts() ) { + $query->the_post(); - - - - + /* + * Include the Post-Format-specific template for the content. + * If you want to override this in a child theme, then include a file + * called content-___.php (where ___ is the Post Format name) and that will be used instead. + */ + get_template_part( 'template-parts/content', 'list' ); + } + } else { + get_template_part( 'template-parts/content', 'none' ); + } - -
        - -
        + if ( '' !== $coletivo_news_more_link ) { + ?> +
        + + + +
        @@ -70,10 +99,12 @@
        - - - - - + + Date: Sat, 8 May 2021 15:11:49 -0300 Subject: [PATCH 12/32] Coding standards (pasta section-parts) - section-portfolio.php; - section-services.php; - section-social.php. --- section-parts/section-portfolio.php | 121 ++++++++------ section-parts/section-services.php | 243 +++++++++++++++------------- section-parts/section-social.php | 149 +++++++++-------- 3 files changed, 289 insertions(+), 224 deletions(-) diff --git a/section-parts/section-portfolio.php b/section-parts/section-portfolio.php index 73d51d3..bbcf859 100644 --- a/section-parts/section-portfolio.php +++ b/section-parts/section-portfolio.php @@ -1,62 +1,83 @@ - - -
        class=""> - - +if ( ! $coletivo_portfolio_disable ) { + $desc = get_theme_mod( 'coletivo_portfolio_desc' ); + if ( ! coletivo_is_selective_refresh() ) { + ?> +
        class=""> + +
        - -
        - ' . esc_html( $coletivo_portfolio_subtitle ) . ''; ?> - ' . esc_html( $coletivo_portfolio_title ) . ''; ?> - ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; - } ?> -
        + +
        + ' . esc_html( $coletivo_portfolio_subtitle ) . ''; + } + + if ( '' !== $coletivo_portfolio_title ) { + echo '

        ' . esc_html( $coletivo_portfolio_title ) . '

        '; + } + + if ( $desc ) { + echo '
        ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; // phpcs:ignore + } + ?> +
        'jetpack-portfolio', - 'posts_per_page' => $coletivo_portfolio_number, + $args = array( + 'post_type' => 'jetpack-portfolio', + 'posts_per_page' => $coletivo_portfolio_number, 'suppress_filters' => 0, ); - $query = new WP_Query( $args ); if ( $query->have_posts() ) : ?> - - have_posts() ) : $query->the_post(); ?> - + $query = new WP_Query( $args ); + if ( $query->have_posts() ) { + /* Start the Loop */ + while ( $query->have_posts() ) { + $query->the_post(); - - + /* + * Include the Post-Format-specific template for the content. + * If you want to override this in a child theme, then include a file + * called content-___.php (where ___ is the Post Format name) and that will be used instead. + */ + get_template_part( 'template-parts/content', 'list' ); - -
        - -
        + } + } + + if ( '' !== $coletivo_portfolio_more_link ) { + ?> +
        + + + +
        @@ -65,10 +86,12 @@
        - - -
        - - +
        + - - -
        - class=""> - - -
        - -
        - ' . esc_html($coletivo_service_subtitle) . ''; ?> - ' . esc_html($coletivo_service_title) . ''; ?> - ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; - } ?> -
        - -
        - +
        class=""> + + +
        + +
        + ' . esc_html( $coletivo_service_subtitle ) . ''; + } + + if ( '' !== $coletivo_service_title ) { + echo '

        ' . esc_html( $coletivo_service_title ) . '

        '; + } + + if ( $desc ) { + echo '
        ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; // phpcs:ignore + } + ?> +
        + +
        +
        '; - } - } else if ( $settings['icon'] ) { - $settings['icon'] = trim( $settings['icon'] ); - // Get Set social icons - if ( $settings['icon'] != '' && strpos($settings['icon'], 'fa') !== 0) { - $settings['icon'] = 'fa-' . $settings['icon']; - } - $media = '
        '; - } + if ( 'image' === $settings['icon_type'] && $settings['image'] ) { + $url = coletivo_get_media_url( $settings['image'] ); + if ( $url ) { + $media = '
        '; + } + } elseif ( $settings['icon'] ) { + $settings['icon'] = trim( $settings['icon'] ); + // Get Set social icons. + if ( '' !== $settings['icon'] && 0 !== strpos( $settings['icon'], 'fa' ) ) { + $settings['icon'] = 'fa-' . $settings['icon']; + } + $media = '
        '; + } - $classes = 'col-sm-6 col-lg-'.$layout; - if ($j >= $columns) { - $j = 1; - $classes .= ' clearleft'; - } else { - $j++; - } + $classes = 'col-sm-6 col-lg-' . $layout; + if ( $j >= $columns ) { + $j = 1; + $classes .= ' clearleft'; + } else { + $j++; + } - ?> -
        -
        - - - - -
        - -
        - - -
        -

        - -
        -
        -
        - +
        +
        + + + + +
        + +
        + + +
        +

        + +
        +
        +
        + -
        -
        - - -
        - - + + + + + - - -
        - class=""> - - - + + +
        + Date: Sat, 8 May 2021 15:21:54 -0300 Subject: [PATCH 13/32] =?UTF-8?q?Altera=C3=A7=C3=A3o=20m=C3=ADnima?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- section-parts/section-contact.php | 2 +- section-parts/section-featuredpage.php | 2 +- section-parts/section-features.php | 3 +-- section-parts/section-gallery.php | 3 +-- section-parts/section-news.php | 8 +------- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/section-parts/section-contact.php b/section-parts/section-contact.php index dc12bc5..999d05b 100644 --- a/section-parts/section-contact.php +++ b/section-parts/section-contact.php @@ -31,7 +31,7 @@ if ( ! $coletivo_contact_disable ) { if ( ! coletivo_is_selective_refresh() ) { ?> -
        class=""> +
        class=""> -
        class=""> +
        class="">
        diff --git a/section-parts/section-features.php b/section-parts/section-features.php index eeef103..721e837 100644 --- a/section-parts/section-features.php +++ b/section-parts/section-features.php @@ -18,8 +18,7 @@ ?> -
        - class=""> +
        class="">
        diff --git a/section-parts/section-gallery.php b/section-parts/section-gallery.php index bada73f..9cc7c34 100644 --- a/section-parts/section-gallery.php +++ b/section-parts/section-gallery.php @@ -19,8 +19,7 @@ ?> -
        + +
        + - - -
        - class=""> - -
        - -
        - ' . esc_html($coletivo_yourslider_subtitle) . ''; ?> - ' . esc_html($coletivo_yourslider_title) . ''; ?> -
        - ' . apply_filters( 'the_content', wp_kses_post( $coletivo_yourslider_shortcode ) ) . '
        '; - } ?> - - -
        - - -
        - Date: Sat, 8 May 2021 17:07:48 -0300 Subject: [PATCH 15/32] =?UTF-8?q?Fix:=20Sanitiza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- section-parts/section-contact.php | 6 +++--- section-parts/section-features.php | 2 +- section-parts/section-gallery.php | 2 +- section-parts/section-hero.php | 2 +- section-parts/section-news.php | 2 +- section-parts/section-portfolio.php | 2 +- section-parts/section-services.php | 2 +- section-parts/section-team.php | 2 +- section-parts/section-videolightbox.php | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/section-parts/section-contact.php b/section-parts/section-contact.php index 999d05b..1eb0988 100644 --- a/section-parts/section-contact.php +++ b/section-parts/section-contact.php @@ -49,7 +49,7 @@ } if ( $desc ) { - echo '
        ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; // phpcs:ignore + echo '
        ' . wp_kses_post( apply_filters( 'the_content', $desc ) ) . '
        '; } ?> @@ -61,7 +61,7 @@ if ( isset( $coletivo_contact_cf7 ) && '' !== $coletivo_contact_cf7 ) { ?>
        - +
        -
        +
        diff --git a/section-parts/section-features.php b/section-parts/section-features.php index 721e837..73d5ca1 100644 --- a/section-parts/section-features.php +++ b/section-parts/section-features.php @@ -34,7 +34,7 @@ } if ( $coletivo_features_desc ) { - echo '
        ' . apply_filters( 'the_content', wp_kses_post( $coletivo_features_desc ) ) . '
        '; // phpcs:ignore + echo '
        ' . wp_kses_post( apply_filters( 'the_content', $coletivo_features_desc ) ) . '
        '; } ?> diff --git a/section-parts/section-gallery.php b/section-parts/section-gallery.php index 9cc7c34..61a73fb 100644 --- a/section-parts/section-gallery.php +++ b/section-parts/section-gallery.php @@ -35,7 +35,7 @@ } if ( $coletivo_gallery_desc ) { - echo '
        ' . apply_filters( 'the_content', wp_kses_post( $coletivo_gallery_desc ) ) . '
        '; // phpcs:ignore + echo '
        ' . wp_kses_post( apply_filters( 'the_content', $coletivo_gallery_desc ) ) . '
        '; } ?> diff --git a/section-parts/section-hero.php b/section-parts/section-hero.php index 77465d9..04f8dc1 100644 --- a/section-parts/section-hero.php +++ b/section-parts/section-hero.php @@ -79,7 +79,7 @@
        ' .apply_filters( 'the_content', wp_kses_post( $hcl2_content ) ). '
        '; // phpcs:ignore + echo '
        ' . wp_kses_post( apply_filters( 'the_content', $hcl2_content ) ) . '
        '; } ?> diff --git a/section-parts/section-news.php b/section-parts/section-news.php index 5b34368..7cb6b8c 100644 --- a/section-parts/section-news.php +++ b/section-parts/section-news.php @@ -41,7 +41,7 @@ } if ( $desc ) { - echo '
        ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; // phpcs:ignore + echo '
        ' . wp_kses_post( apply_filters( 'the_content', $desc ) ) . '
        '; } ?> diff --git a/section-parts/section-portfolio.php b/section-parts/section-portfolio.php index bbcf859..397355e 100644 --- a/section-parts/section-portfolio.php +++ b/section-parts/section-portfolio.php @@ -36,7 +36,7 @@ } if ( $desc ) { - echo '
        ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; // phpcs:ignore + echo '
        ' . wp_kses_post( apply_filters( 'the_content', $desc ) ) . '
        '; } ?> diff --git a/section-parts/section-services.php b/section-parts/section-services.php index 73cb380..560e699 100644 --- a/section-parts/section-services.php +++ b/section-parts/section-services.php @@ -39,7 +39,7 @@ } if ( $desc ) { - echo '
        ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
        '; // phpcs:ignore + echo '
        ' . wp_kses_post( apply_filters( 'the_content', $desc ) ) . '
        '; } ?> diff --git a/section-parts/section-team.php b/section-parts/section-team.php index 6933580..f5a926a 100644 --- a/section-parts/section-team.php +++ b/section-parts/section-team.php @@ -93,7 +93,7 @@ - post_content ); ?> + post_content ); ?> From 799ef7f436605dc9938f51d93a6513066466e21d Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sat, 8 May 2021 21:06:54 -0300 Subject: [PATCH 16/32] Coding standards (pasta template-parts) --- template-parts/content-list.php | 23 ++++++++++----------- template-parts/content-none.php | 2 +- template-parts/content-page.php | 9 +++++---- template-parts/content-single.php | 9 +++++---- template-parts/content.php | 33 +++++++++++++++++-------------- 5 files changed, 41 insertions(+), 35 deletions(-) diff --git a/template-parts/content-list.php b/template-parts/content-list.php index cc7dd9b..de41c66 100644 --- a/template-parts/content-list.php +++ b/template-parts/content-list.php @@ -6,17 +6,18 @@ * * @package coletivo */ + ?> -
        > +
        >
        '; + echo ''; } ?> @@ -24,7 +25,7 @@
        ', esc_url( get_permalink() ) ), '' ); ?> @@ -32,13 +33,13 @@
        - '', - ) ); - ?> + wp_link_pages( + array( + 'before' => '', + ) + ); + ?>
        diff --git a/template-parts/content-none.php b/template-parts/content-none.php index 4589b9a..4a41166 100644 --- a/template-parts/content-none.php +++ b/template-parts/content-none.php @@ -10,7 +10,7 @@ ?>
        - +

        diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 6513db6..76c191f 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -15,13 +15,14 @@
        - '', - ) ); + ) + ); ?>
        - diff --git a/template-parts/content-single.php b/template-parts/content-single.php index e98cabe..1554fdd 100644 --- a/template-parts/content-single.php +++ b/template-parts/content-single.php @@ -12,12 +12,14 @@
        >
        - '', - ) ); + ) + ); ?>
        @@ -25,4 +27,3 @@
        - diff --git a/template-parts/content.php b/template-parts/content.php index 9e6a019..016cf7e 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -6,10 +6,11 @@ * * @package coletivo */ + $blog_style = get_theme_mod( 'coletivo_blog_page_style', 'grid' ); ?>
        > - +
        ', esc_url( get_permalink() ) ), '' ); ?> @@ -20,37 +21,39 @@
        - +
        ', esc_url( get_permalink() ) ), '' ); ?>
        '', - ) ); + ) + ); ?>
        From 02cf4881eff06043b2693a950880ef45bdae55fd Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sat, 8 May 2021 21:36:35 -0300 Subject: [PATCH 17/32] =?UTF-8?q?Fix:=20Substitui=C3=A7=C3=A3o=20de=20vari?= =?UTF-8?q?=C3=A1veis=20globais=20do=20WordPress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/customizer.php | 10 +++++----- template-frontpage.php | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/inc/customizer.php b/inc/customizer.php index 63f808d..36192e0 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -294,11 +294,11 @@ function coletivo_customize_controls_enqueue_scripts() { * @return int */ function coletivo_get_customizer_priority( $panel ) { - $panel = str_replace( array( 'coletivo_', '_panel' ), '', $panel ); - $order = get_theme_mod( 'coletivo_sections_order', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ); - $index = 129; - $order = explode( ',', $order ); - foreach ( $order as $key => $value ) { + $panel = str_replace( array( 'coletivo_', '_panel' ), '', $panel ); + $section_order = get_theme_mod( 'coletivo_sections_order', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ); + $index = 129; + $section_order = explode( ',', $section_order ); + foreach ( $section_order as $key => $value ) { $index++; if ( $panel === $value ) { break; diff --git a/template-frontpage.php b/template-frontpage.php index f4968db..c0806f0 100644 --- a/template-frontpage.php +++ b/template-frontpage.php @@ -18,9 +18,9 @@ if ( ! has_action( 'coletivo_frontpage_section_parts' ) ) { - $order = get_theme_mod( 'coletivo_sections_order', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ); - $order = explode( ',', $order ); - $sections = apply_filters( 'coletivo_frontpage_sections_order', $order ); + $section_order = get_theme_mod( 'coletivo_sections_order', 'hero,features,yourslider,featuredpage,services,portfolio,videolightbox,gallery,team,news,contact,social' ); + $section_order = explode( ',', $section_order ); + $sections = apply_filters( 'coletivo_frontpage_sections_order', $section_order ); foreach ( $sections as $section ) { From d0959bde44c8decd14dce9248d22f504e37054ea Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sat, 8 May 2021 21:37:39 -0300 Subject: [PATCH 18/32] =?UTF-8?q?Fix:=20Sanitiza=C3=A7=C3=A3o=20e=20PHPCS?= =?UTF-8?q?=20Ignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archive.php | 2 +- comments.php | 6 +++--- home.php | 2 +- index.php | 2 +- page.php | 2 +- single-jetpack-portfolio.php | 2 +- single.php | 2 +- template-fullwidth.php | 2 +- template-withsidebar.php | 2 +- woocommerce.php | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/archive.php b/archive.php index a4f707d..b0e9f52 100644 --- a/archive.php +++ b/archive.php @@ -23,7 +23,7 @@ diff --git a/comments.php b/comments.php index 38f1f45..6ffb5bc 100644 --- a/comments.php +++ b/comments.php @@ -27,9 +27,9 @@

        ' . esc_html( get_the_title() ) . '' ); ?> diff --git a/home.php b/home.php index e997a05..3200554 100644 --- a/home.php +++ b/home.php @@ -26,7 +26,7 @@

        - +
        diff --git a/index.php b/index.php index 73b65a1..c53ded4 100644 --- a/index.php +++ b/index.php @@ -15,7 +15,7 @@ get_header(); if ( function_exists( 'coletivo_breadcrumb' ) ) { - echo coletivo_breadcrumb(); + echo wp_kses_post( coletivo_breadcrumb() ); } ?> diff --git a/page.php b/page.php index 306f2d2..645b0d8 100644 --- a/page.php +++ b/page.php @@ -17,7 +17,7 @@
        - +
        <?php the_title(); ?>
        diff --git a/single-jetpack-portfolio.php b/single-jetpack-portfolio.php index 79466b5..60a4456 100755 --- a/single-jetpack-portfolio.php +++ b/single-jetpack-portfolio.php @@ -11,7 +11,7 @@ ?>
        - +
        diff --git a/single.php b/single.php index 36f316e..e23c9e1 100644 --- a/single.php +++ b/single.php @@ -12,7 +12,7 @@
        - +
        <?php the_title(); ?>
        diff --git a/template-fullwidth.php b/template-fullwidth.php index 7ef8c7a..a69b1d3 100644 --- a/template-fullwidth.php +++ b/template-fullwidth.php @@ -10,7 +10,7 @@ get_header(); ?> - +
        <?php the_title(); ?>
        diff --git a/template-withsidebar.php b/template-withsidebar.php index 3ed1665..3a510fa 100644 --- a/template-withsidebar.php +++ b/template-withsidebar.php @@ -16,7 +16,7 @@
        - + - +
        From 2da98a7cba160862b8682445a3a805d724952f59 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sat, 8 May 2021 21:50:07 -0300 Subject: [PATCH 19/32] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20do=20Readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 08704df..7a6523e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ for business, portfolio, digital agency, product showcase, freelancers and everyone else who appreciate good design. Is a fork of the OnePress theme, by Fame Themes. -* Contributors: redelivre, brasadesign, famethemes, congthien, kientrong, diegorojas, matheusgimenez, 2aces +* Contributors: [redelivre](https://github.com/redelivre), [brasadesign](https://profiles.wordpress.org/brasadesign/), [famethemes](https://profiles.wordpress.org/famethemes/), [congthien](https://profiles.wordpress.org/congthien/), [kientrong](https://profiles.wordpress.org/kientrong/), [diegorojas](https://profiles.wordpress.org/diegorojas/), [matheusgimenez](https://profiles.wordpress.org/matheusgimenez/), [2aces](https://profiles.wordpress.org/2aces/), [rodineicosta](https://profiles.wordpress.org/rodineicosta/) * Tags: one-column, two-columns, left-sidebar, right-sidebar, fluid-layout, responsive-layout, custom-menu, featured-images, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, blue, light * Tested up to: 5.2 * Stable tag: 1.7 @@ -16,7 +16,7 @@ by Fame Themes. Coletivo is distributed under the terms of the GNU GPL -[![Join the chat at https://telegram.me/IdentidadeDigital](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/RedeLivreOrg) + [![Join the chat at https://telegram.me/IdentidadeDigital](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/RedeLivreOrg) # capturas ![Screenshot](./screenshot.png) @@ -27,12 +27,12 @@ Coletivo is distributed under the terms of the GNU GPL 2. Click Upload and Choose File, then select the theme's .zip file. Click Install Now. 3. Click Activate to use your new theme right away. -## Frequently Asked Questions +## Frequently Asked Questions ### How to set up the blog page? First create a page and give it a name ( Note this page will also be the URL of your blog, example "Blog", "News" ... ), at the right site - Template section select Blog Page and then Save. Now you can access your blog at http://yourdomain.com/blog ( or http://yourdomain.com/news ) -### How to set up the one page menu like the demo? +### How to set up the one page menu like the demo? There are a lot of sections available in these theme: Hero, Features, Your Slider, Featured Page, Services, Portfolio, Video Lightbox, Gallery, Team, News, Contact. For each section, you will need to create a text link menu with anchor point to the ID of the section, like: From 5e9c5e86d86f1687ac3fceea1cd3eb672bda9f12 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sun, 9 May 2021 00:31:29 -0300 Subject: [PATCH 20/32] =?UTF-8?q?Instala=C3=A7=C3=A3o=20e=20configura?= =?UTF-8?q?=C3=A7=C3=A3o=20do=20Composer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 22 ++ vendor/autoload.php | 7 + vendor/composer/ClassLoader.php | 445 ++++++++++++++++++++++++ vendor/composer/LICENSE | 21 ++ vendor/composer/autoload_classmap.php | 15 + vendor/composer/autoload_namespaces.php | 9 + vendor/composer/autoload_psr4.php | 10 + vendor/composer/autoload_real.php | 55 +++ vendor/composer/autoload_static.php | 41 +++ vendor/composer/installed.json | 1 + 10 files changed, 626 insertions(+) create mode 100644 composer.json create mode 100644 vendor/autoload.php create mode 100644 vendor/composer/ClassLoader.php create mode 100644 vendor/composer/LICENSE create mode 100644 vendor/composer/autoload_classmap.php create mode 100644 vendor/composer/autoload_namespaces.php create mode 100644 vendor/composer/autoload_psr4.php create mode 100644 vendor/composer/autoload_real.php create mode 100644 vendor/composer/autoload_static.php create mode 100644 vendor/composer/installed.json diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..3ece44c --- /dev/null +++ b/composer.json @@ -0,0 +1,22 @@ +{ + "name": "redelivre/coletivo", + "description": "Coletivo theme is an outstanding creative and flexible WordPress one page theme well suited for business, portfolio, digital agency, product showcase, freelancers and everyone else who appreciate good design.", + "homepage": "https://tema.coletivowp.com.br/", + "type": "wordpress-theme", + "license": "GPLv2", + "authors": [ + { + "name": "Rede Livre" + }, + { + "name": "Rodinei Costa", + "email": "rodineicosta@physistec.com.br", + "role": "Developer" + } + ], + "autoload": { + "psr-4": { + "Coletivo\\": "inc/" + } + } +} diff --git a/vendor/autoload.php b/vendor/autoload.php new file mode 100644 index 0000000..4184af5 --- /dev/null +++ b/vendor/autoload.php @@ -0,0 +1,7 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + private $classMapAuthoritative = false; + private $missingClasses = array(); + private $apcuPrefix; + + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 0000000..f27399a --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000..b8db740 --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,15 @@ + $baseDir . '/inc/class-alpha-color-control.php', + 'Coletivo\\Customize_Repeatable_Control' => $baseDir . '/inc/class-customize-repeatable-control.php', + 'Coletivo\\Editor_Custom_Control' => $baseDir . '/inc/class-editor-custom-control.php', + 'Coletivo\\Editor_Scripts' => $baseDir . '/inc/class-editor-scripts.php', + 'Coletivo\\Misc_Control' => $baseDir . '/inc/class-misc-control.php', + 'Coletivo\\Textarea_Custom_Control' => $baseDir . '/inc/class-textarea-custom-control.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 0000000..b7fc012 --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($baseDir . '/inc'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 0000000..9d88fbc --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,55 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInitee95b5323bc168289d8c536d1a93cb7f::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + return $loader; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 0000000..b8bab32 --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,41 @@ + + array ( + 'Coletivo\\' => 9, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Coletivo\\' => + array ( + 0 => __DIR__ . '/../..' . '/inc', + ), + ); + + public static $classMap = array ( + 'Coletivo\\Alpha_Color_Control' => __DIR__ . '/../..' . '/inc/class-alpha-color-control.php', + 'Coletivo\\Customize_Repeatable_Control' => __DIR__ . '/../..' . '/inc/class-customize-repeatable-control.php', + 'Coletivo\\Editor_Custom_Control' => __DIR__ . '/../..' . '/inc/class-editor-custom-control.php', + 'Coletivo\\Editor_Scripts' => __DIR__ . '/../..' . '/inc/class-editor-scripts.php', + 'Coletivo\\Misc_Control' => __DIR__ . '/../..' . '/inc/class-misc-control.php', + 'Coletivo\\Textarea_Custom_Control' => __DIR__ . '/../..' . '/inc/class-textarea-custom-control.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInitee95b5323bc168289d8c536d1a93cb7f::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitee95b5323bc168289d8c536d1a93cb7f::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitee95b5323bc168289d8c536d1a93cb7f::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1 @@ +[] From ad40afe21485efddbf27e1e5a4967bc3ba07623a Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sun, 9 May 2021 00:31:55 -0300 Subject: [PATCH 21/32] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20do=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 78f0010..63be8c3 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ ._* .cache .DS_Store +.editorconfig .idea .project .settings @@ -30,7 +31,15 @@ node_modules .sass-cache # Ignore project files -sftp-config.json +bin/ +tests/ .ftppass -*.zip -src/node_modules/* \ No newline at end of file +.phpcs.xml.dist +.travis.yml +sftp-config.json +phpcs.ruleset.xml +phpunit.xml.dist + +vendor/* +!vendor/autoload.php +!vendor/composer/ From 48e511e080eda7859536903349989ee8f8462afa Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sun, 9 May 2021 00:33:01 -0300 Subject: [PATCH 22/32] =?UTF-8?q?Separa=C3=A7=C3=A3o=20de=20Classes=20em?= =?UTF-8?q?=20arquivos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/class-alpha-color-control.php | 105 +++ inc/class-customize-repeatable-control.php | 466 ++++++++++++++ inc/class-editor-custom-control.php | 57 ++ inc/class-editor-scripts.php | 65 ++ inc/class-misc-control.php | 61 ++ inc/class-textarea-custom-control.php | 35 + inc/customizer-controls.php | 704 +-------------------- 7 files changed, 812 insertions(+), 681 deletions(-) create mode 100644 inc/class-alpha-color-control.php create mode 100644 inc/class-customize-repeatable-control.php create mode 100644 inc/class-editor-custom-control.php create mode 100644 inc/class-editor-scripts.php create mode 100644 inc/class-misc-control.php create mode 100644 inc/class-textarea-custom-control.php diff --git a/inc/class-alpha-color-control.php b/inc/class-alpha-color-control.php new file mode 100644 index 0000000..0589091 --- /dev/null +++ b/inc/class-alpha-color-control.php @@ -0,0 +1,105 @@ +. + */ +class Alpha_Color_Control extends WP_Customize_Control { + + /** + * Official control name. + * + * @var string + */ + public $type = 'alpha-color'; + + /** + * Add support for palettes to be passed in. + * + * Supported palette values are true, false, or an array of RGBa and Hex colors. + * + * @var bool|array + */ + public $palette; + + /** + * Add support for showing the opacity value on the slider handle. + * + * @var int + */ + public $show_opacity; + + /** + * Enqueue scripts and styles. + * + * Ideally these would get registered and given proper paths before this control object + * gets initialized, then we could simply enqueue them here, but for completeness as a + * stand alone class we'll register and enqueue them here. + */ + public function enqueue() { + + } + + /** + * Render the control. + */ + public function render_content() { + + // Process the palette. + if ( is_array( $this->palette ) ) { + $palette = implode( '|', $this->palette ); + } else { + // Default to true. + $palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true'; + } + + // Support passing show_opacity as string or boolean. Default to true. + $show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true'; + + // Begin the output. + ?> + + $op ) { + $args['fields'][ $key ]['id'] = $key; + if ( ! isset( $op['value'] ) ) { + if ( isset( $op['default'] ) ) { + $args['fields'][ $key ]['value'] = $op['default']; + } else { + $args['fields'][ $key ]['value'] = ''; + } + } + } + + $this->fields = $args['fields']; + $this->live_title_id = isset( $args['live_title_id'] ) ? $args['live_title_id'] : false; + $this->defined_values = isset( $args['defined_values'] ) ? $args['defined_values'] : false; + $this->id_key = isset( $args['id_key'] ) ? $args['id_key'] : false; + if ( isset( $args['title_format'] ) && '' !== $args['title_format'] ) { + $this->title_format = $args['title_format']; + } else { + $this->title_format = ''; + } + + if ( isset( $args['limited_msg'] ) && '' !== $args['limited_msg'] ) { + $this->limited_msg = $args['limited_msg']; + } else { + $this->limited_msg = ''; + } + + if ( ! isset( $args['max_item'] ) ) { + $args['max_item'] = 0; + } + + if ( ! isset( $args['allow_unlimited'] ) || false !== $args['allow_unlimited'] ) { + $this->max_item = apply_filters( 'coletivo_reepeatable_max_item', absint( $args['max_item'] ) ); + } else { + $this->max_item = absint( $args['max_item'] ); + } + + $this->changeable = isset( $args['changeable'] ) && 'no' === $args['changeable'] ? 'no' : 'yes'; + $this->default_empty_title = isset( $args['default_empty_title'] ) && '' !== $args['default_empty_title'] ? $args['default_empty_title'] : esc_html__( 'Item', 'coletivo' ); + } + + /** + * Merge data + * + * @access public + * @param array $array_value Array value. + * @param array $array_default Array value. + * + * @return array + */ + public function merge_data( $array_value, $array_default ) { + + if ( ! $this->id_key ) { + return $array_value; + } + + if ( ! is_array( $array_value ) ) { + $array_value = array(); + } + + if ( ! is_array( $array_default ) ) { + $array_default = array(); + } + + $new_array = array(); + foreach ( $array_value as $k => $a ) { + + if ( is_array( $a ) ) { + if ( isset( $a[ $this->id_key ] ) && '' !== $a[ $this->id_key ] ) { + $new_array[ $a[ $this->id_key ] ] = $a; + } else { + $new_array[ $k ] = $a; + } + } + } + + foreach ( $array_default as $k => $a ) { + if ( is_array( $a ) && isset( $a[ $this->id_key ] ) ) { + if ( ! isset( $new_array[ $a[ $this->id_key ] ] ) ) { + $new_array[ $a[ $this->id_key ] ] = $a; + } + } + } + + return array_values( $new_array ); + } + + /** + * To JSON + * + * @access public + * + * @return void + */ + public function to_json() { + parent::to_json(); + $value = $this->value(); + + if ( is_string( $value ) ) { + $value = json_decode( $value, true ); + } + if ( empty( $value ) ) { + $value = $this->defined_values; + } elseif ( is_array( $this->defined_values ) && ! empty( $this->defined_values ) ) { + $value = $this->merge_data( $value, $this->defined_values ); + } + + $this->json['live_title_id'] = $this->live_title_id; + $this->json['title_format'] = $this->title_format; + $this->json['max_item'] = $this->max_item; + $this->json['limited_msg'] = $this->limited_msg; + $this->json['changeable'] = $this->changeable; + $this->json['default_empty_title'] = $this->default_empty_title; + $this->json['value'] = $value; + $this->json['id_key'] = $this->id_key; + $this->json['fields'] = $this->fields; + } + + /** + * Enqueue scripts/styles. + * + * @since 1.0.0 + * @access public + * + * @return void + */ + public function enqueue() { + add_action( 'customize_controls_print_footer_scripts', array( $this, 'item_tpl' ), 66 ); + } + + /** + * Item TPL + * + * @access public + * + * @return void + */ + public function item_tpl() { + ?> + + + + input_attrs(); ?> value="" link(); ?> /> +
        +
          +
          +
          + +
          + +
        • +
          +
          +
          + +
          +
          +

          +
          +
          + +
          +
          +
          + <# var cond_v; #> + <# for ( i in data ) { #> + <# if ( ! data.hasOwnProperty( i ) ) continue; #> + <# field = data[i]; #> + <# if ( ! field.type ) continue; #> + <# if ( field.type ){ #> + + <# + if ( field.required && field.required.length >= 3 ) { + #> +
          + <# + } else { + #> +
          + <# + } + #> + <# if ( 'checkbox' !== field.type ) { #> + <# if ( field.title ) { #> + + <# } #> + + <# if ( field.desc ) { #> +

          {{{ field.desc }}}

          + <# } #> + <# } #> + + <# if ( 'hidden' === field.type ) { #> + + <# } else if ( 'add_by' === field.type ) { #> + + <# } else if ( 'text' === field.type ) { #> + + <# } else if ( 'checkbox' === field.type ) { #> + + <# if ( field.title ) { #> + + <# } #> + + <# if ( field.desc ) { #> +

          {{ field.desc }}

          + <# } #> + + + <# } else if ( 'select' === field.type ) { #> + + <# if ( field.multiple ) { #> + + <# } #> + + <# for ( k in field.options ) { #> + <# if ( _.isArray( field.value ) ) { #> + + <# } else { #> + + <# } #> + <# } #> + + + <# } else if ( 'radio' === field.type ) { #> + + <# for ( k in field.options ) { #> + + <# if ( field.options.hasOwnProperty( k ) ) { #> + + + + <# } #> + <# } #> + + <# } else if ( 'color' === field.type || 'coloralpha' === field.type ) { #> + + <# if ( '' !== field.value ) { field.value = '#'+field.value ; } #> + + + + <# } else if ( 'media' === field.type ) { #> + + <# if ( ! field.media || '' === field.media || 'image' === field.media ) { #> + + <# } else { #> + + <# } #> + + + <# if ( ! field.media || '' === field.media || 'image' === field.media ) { #> +
          +
          +
          +
          + <# if ( '' !== field.value.url ){ #> + + <# } #> +
          +
          +
          +
          + <# } #> + +
          + + +
          +
          + + <# } else if ( 'textarea' === field.type || 'editor' === field.type ) { #> + + <# } else if ( 'icon' === field.type ) { #> + <# + var icon_class = field.value; + if ( 0 !== icon_class.indexOf( 'fa-' ) ) { + icon_class = 'fa-' + field.value; + } else { + icon_class = icon_class.replace( 'fa ', '' ); + } + icon_class = icon_class.replace( 'fa-fa', '' ); + + #> +
          + + +
          + + <# } #> + +
          + + <# } #> + <# } #> +
          +
          + + + | + + +
          +
          +
          +
          +
          + +
          + +
          +
        • + mod = strtolower( (string) $this->mod ); + if ( ! 'html' === $this->mod ) { + $this->mod = 'tmce'; + } + ?> +
          + + +

          description ); ?>

          +
          + + + type ) { + case 'heading': + echo '' . esc_html( $this->title ) . ''; + break; + + case 'custom_message': + echo '

          ' . esc_html( $this->description ) . '

          '; + break; + + case 'hr': + echo '
          '; + break; + } + } +} diff --git a/inc/class-textarea-custom-control.php b/inc/class-textarea-custom-control.php new file mode 100644 index 0000000..2464046 --- /dev/null +++ b/inc/class-textarea-custom-control.php @@ -0,0 +1,35 @@ + + + type ) { - case 'heading': - echo '' . esc_html( $this->title ) . ''; - break; +namespace Coletivo; - case 'custom_message': - echo '

          ' . esc_html( $this->description ) . '

          '; - break; +/* Autoload */ +if ( version_compare( PHP_VERSION, '5.6.0', '>=' ) ) { + require get_template_directory() . '/vendor/autoload.php'; +} - case 'hr': - echo '
          '; - break; - } - } +if ( ! class_exists( 'Misc_Control' ) ) { + require_once get_template_directory() . '/inc/class-misc-control.php'; } -/** - * Text Area Custom Control Class - */ -class Coletivo_Textarea_Custom_Control extends WP_Customize_Control { - /** - * Render the description and title for the sections - */ - public function render_content() { - ?> - - mod = strtolower( $this->mod ); - if ( ! 'html' === $this->mod ) { - $this->mod = 'tmce'; - } - ?> -
          - - -

          description ); ?>

          -
          - . - */ -class Coletivo_Alpha_Color_Control extends WP_Customize_Control { - - /** - * Official control name. - * - * @var string - */ - public $type = 'alpha-color'; - - /** - * Add support for palettes to be passed in. - * - * Supported palette values are true, false, or an array of RGBa and Hex colors. - * - * @var bool|array - */ - public $palette; - - /** - * Add support for showing the opacity value on the slider handle. - * - * @var int - */ - public $show_opacity; - - /** - * Enqueue scripts and styles. - * - * Ideally these would get registered and given proper paths before this control object - * gets initialized, then we could simply enqueue them here, but for completeness as a - * stand alone class we'll register and enqueue them here. - */ - public function enqueue() { - - } - - /** - * Render the control. - */ - public function render_content() { - - // Process the palette. - if ( is_array( $this->palette ) ) { - $palette = implode( '|', $this->palette ); - } else { - // Default to true. - $palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true'; - } - - // Support passing show_opacity as string or boolean. Default to true. - $show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true'; - - // Begin the output. - ?> - - $op ) { - $args['fields'][ $key ]['id'] = $key; - if ( ! isset( $op['value'] ) ) { - if ( isset( $op['default'] ) ) { - $args['fields'][ $key ]['value'] = $op['default']; - } else { - $args['fields'][ $key ]['value'] = ''; - } - } - } - - $this->fields = $args['fields']; - $this->live_title_id = isset( $args['live_title_id'] ) ? $args['live_title_id'] : false; - $this->defined_values = isset( $args['defined_values'] ) ? $args['defined_values'] : false; - $this->id_key = isset( $args['id_key'] ) ? $args['id_key'] : false; - if ( isset( $args['title_format'] ) && '' !== $args['title_format'] ) { - $this->title_format = $args['title_format']; - } else { - $this->title_format = ''; - } - - if ( isset( $args['limited_msg'] ) && '' !== $args['limited_msg'] ) { - $this->limited_msg = $args['limited_msg']; - } else { - $this->limited_msg = ''; - } - - if ( ! isset( $args['max_item'] ) ) { - $args['max_item'] = 0; - } - - if ( ! isset( $args['allow_unlimited'] ) || false !== $args['allow_unlimited'] ) { - $this->max_item = apply_filters( 'coletivo_reepeatable_max_item', absint( $args['max_item'] ) ); - } else { - $this->max_item = absint( $args['max_item'] ); - } - - $this->changeable = isset( $args['changeable'] ) && 'no' === $args['changeable'] ? 'no' : 'yes'; - $this->default_empty_title = isset( $args['default_empty_title'] ) && '' !== $args['default_empty_title'] ? $args['default_empty_title'] : esc_html__( 'Item', 'coletivo' ); - } - - /** - * Merge data - * - * @access public - * @param array $array_value Array value. - * @param array $array_default Array value. - * - * @return array - */ - public function merge_data( $array_value, $array_default ) { - - if ( ! $this->id_key ) { - return $array_value; - } - - if ( ! is_array( $array_value ) ) { - $array_value = array(); - } - - if ( ! is_array( $array_default ) ) { - $array_default = array(); - } - - $new_array = array(); - foreach ( $array_value as $k => $a ) { - - if ( is_array( $a ) ) { - if ( isset( $a[ $this->id_key ] ) && '' !== $a[ $this->id_key ] ) { - $new_array[ $a[ $this->id_key ] ] = $a; - } else { - $new_array[ $k ] = $a; - } - } - } - - foreach ( $array_default as $k => $a ) { - if ( is_array( $a ) && isset( $a[ $this->id_key ] ) ) { - if ( ! isset( $new_array[ $a[ $this->id_key ] ] ) ) { - $new_array[ $a[ $this->id_key ] ] = $a; - } - } - } - - return array_values( $new_array ); - } - - /** - * To JSON - * - * @access public - * - * @return void - */ - public function to_json() { - parent::to_json(); - $value = $this->value(); - - if ( is_string( $value ) ) { - $value = json_decode( $value, true ); - } - if ( empty( $value ) ) { - $value = $this->defined_values; - } elseif ( is_array( $this->defined_values ) && ! empty( $this->defined_values ) ) { - $value = $this->merge_data( $value, $this->defined_values ); - } - - $this->json['live_title_id'] = $this->live_title_id; - $this->json['title_format'] = $this->title_format; - $this->json['max_item'] = $this->max_item; - $this->json['limited_msg'] = $this->limited_msg; - $this->json['changeable'] = $this->changeable; - $this->json['default_empty_title'] = $this->default_empty_title; - $this->json['value'] = $value; - $this->json['id_key'] = $this->id_key; - $this->json['fields'] = $this->fields; - } - - /** - * Enqueue scripts/styles. - * - * @since 1.0.0 - * @access public - * - * @return void - */ - public function enqueue() { - add_action( 'customize_controls_print_footer_scripts', array( $this, 'item_tpl' ), 66 ); - } - - /** - * Item TPL - * - * @access public - * - * @return void - */ - public function item_tpl() { - ?> - - - - input_attrs(); ?> value="" link(); ?> /> -
          -
            -
            -
            - -
            - -
          • -
            -
            -
            - -
            -
            -

            -
            -
            - -
            -
            -
            - <# var cond_v; #> - <# for ( i in data ) { #> - <# if ( ! data.hasOwnProperty( i ) ) continue; #> - <# field = data[i]; #> - <# if ( ! field.type ) continue; #> - <# if ( field.type ){ #> - - <# - if ( field.required && field.required.length >= 3 ) { - #> -
            - <# - } else { - #> -
            - <# - } - #> - <# if ( 'checkbox' !== field.type ) { #> - <# if ( field.title ) { #> - - <# } #> - - <# if ( field.desc ) { #> -

            {{{ field.desc }}}

            - <# } #> - <# } #> - - <# if ( 'hidden' === field.type ) { #> - - <# } else if ( 'add_by' === field.type ) { #> - - <# } else if ( 'text' === field.type ) { #> - - <# } else if ( 'checkbox' === field.type ) { #> - - <# if ( field.title ) { #> - - <# } #> - - <# if ( field.desc ) { #> -

            {{ field.desc }}

            - <# } #> - - - <# } else if ( 'select' === field.type ) { #> - - <# if ( field.multiple ) { #> - - <# } #> - - <# for ( k in field.options ) { #> - <# if ( _.isArray( field.value ) ) { #> - - <# } else { #> - - <# } #> - <# } #> - - - <# } else if ( 'radio' === field.type ) { #> - - <# for ( k in field.options ) { #> - - <# if ( field.options.hasOwnProperty( k ) ) { #> - - - - <# } #> - <# } #> - - <# } else if ( 'color' === field.type || 'coloralpha' === field.type ) { #> - - <# if ( '' !== field.value ) { field.value = '#'+field.value ; } #> - - - - <# } else if ( 'media' === field.type ) { #> - - <# if ( ! field.media || '' === field.media || 'image' === field.media ) { #> - - <# } else { #> - - <# } #> - - - <# if ( ! field.media || '' === field.media || 'image' === field.media ) { #> -
            -
            -
            -
            - <# if ( '' !== field.value.url ){ #> - - <# } #> -
            -
            -
            -
            - <# } #> - -
            - - -
            -
            - - <# } else if ( 'textarea' === field.type || 'editor' === field.type ) { #> - - <# } else if ( 'icon' === field.type ) { #> - <# - var icon_class = field.value; - if ( 0 !== icon_class.indexOf( 'fa-' ) ) { - icon_class = 'fa-' + field.value; - } else { - icon_class = icon_class.replace( 'fa ', '' ); - } - icon_class = icon_class.replace( 'fa-fa', '' ); - - #> -
            - - -
            - - <# } #> - -
            - - <# } #> - <# } #> -
            -
            - - - | - - -
            -
            -
            -
            -
            - -
            - -
            -
          • - - - __( 'Section: ', 'coletivo' ) ) ); } -add_action( 'customize_controls_enqueue_scripts', 'coletivo_customizer_control_scripts', 99 ); -add_action( 'customize_controls_enqueue_scripts', array( 'coletivo_Editor_Scripts', 'enqueue' ), 95 ); +/** + * Init function + */ +function init() { + add_action( 'customize_controls_enqueue_scripts', 'coletivo_customizer_control_scripts', 99 ); +} From a724aa3ad9309d11e0152aa673d8aed0fb30b221 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sun, 9 May 2021 00:34:42 -0300 Subject: [PATCH 23/32] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20de=20carregamento?= =?UTF-8?q?=20de=20Classes=20nas=20se=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customizer-section-contact.php | 10 ++++++---- .../customizer-section-featured-page.php | 4 +++- .../customizer-section-features.php | 6 ++++-- .../customizer-section-gallery.php | 4 +++- .../customizer-section-hero.php | 14 +++++++++----- .../customizer-section-news.php | 6 ++++-- .../customizer-section-portfolio.php | 4 +++- .../customizer-section-sections.php | 4 +++- .../customizer-section-services.php | 6 ++++-- .../customizer-section-social.php | 7 +++++-- .../customizer-section-team.php | 6 ++++-- .../customizer-section-video-lightbox.php | 5 ++++- 12 files changed, 52 insertions(+), 24 deletions(-) diff --git a/inc/customizer-components/customizer-section-contact.php b/inc/customizer-components/customizer-section-contact.php index 7b478c6..efbd1dd 100644 --- a/inc/customizer-components/customizer-section-contact.php +++ b/inc/customizer-components/customizer-section-contact.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -132,7 +134,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_contact_desc', array( @@ -162,7 +164,7 @@ ); $wp_customize->add_control( - new coletivo_Misc_Control( + new Misc_Control( $wp_customize, 'coletivo_contact_cf7_guide', array( @@ -200,7 +202,7 @@ ); $wp_customize->add_control( - new coletivo_Misc_Control( + new Misc_Control( $wp_customize, 'coletivo_contact_text_hr', array( @@ -237,7 +239,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_contact_text', array( diff --git a/inc/customizer-components/customizer-section-featured-page.php b/inc/customizer-components/customizer-section-featured-page.php index 6523e30..b547a00 100644 --- a/inc/customizer-components/customizer-section-featured-page.php +++ b/inc/customizer-components/customizer-section-featured-page.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -168,7 +170,7 @@ ); $wp_customize->add_control( - new coletivo_Alpha_Color_Control( + new Alpha_Color_Control( $wp_customize, 'coletivo_featuredpage_overlay_color', array( diff --git a/inc/customizer-components/customizer-section-features.php b/inc/customizer-components/customizer-section-features.php index 024bd48..deb92af 100644 --- a/inc/customizer-components/customizer-section-features.php +++ b/inc/customizer-components/customizer-section-features.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -113,7 +115,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_features_desc', array( @@ -168,7 +170,7 @@ ); $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( + new Customize_Repeatable_Control( $wp_customize, 'coletivo_features_boxes', array( diff --git a/inc/customizer-components/customizer-section-gallery.php b/inc/customizer-components/customizer-section-gallery.php index c3f77b1..c216255 100644 --- a/inc/customizer-components/customizer-section-gallery.php +++ b/inc/customizer-components/customizer-section-gallery.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -113,7 +115,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_gallery_desc', array( diff --git a/inc/customizer-components/customizer-section-hero.php b/inc/customizer-components/customizer-section-hero.php index 6992fd1..3153edf 100644 --- a/inc/customizer-components/customizer-section-hero.php +++ b/inc/customizer-components/customizer-section-hero.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -172,7 +174,7 @@ ); $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( + new Customize_Repeatable_Control( $wp_customize, 'coletivo_hero_images', array( @@ -207,7 +209,7 @@ ); $wp_customize->add_control( - new coletivo_Alpha_Color_Control( + new Alpha_Color_Control( $wp_customize, 'coletivo_hero_overlay_color', array( @@ -284,7 +286,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_hcl1_largetext', array( @@ -305,7 +307,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_hcl1_smalltext', array( @@ -453,7 +455,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_hcl2_content', array( @@ -474,6 +476,8 @@ ) ); +use WP_Customize_Image_Control; + $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, diff --git a/inc/customizer-components/customizer-section-news.php b/inc/customizer-components/customizer-section-news.php index 9e4310e..9e19bf1 100644 --- a/inc/customizer-components/customizer-section-news.php +++ b/inc/customizer-components/customizer-section-news.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -113,7 +115,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_news_desc', array( @@ -133,7 +135,7 @@ ); $wp_customize->add_control( - new coletivo_Misc_Control( + new Misc_Control( $wp_customize, 'coletivo_news_settings_hr', array( diff --git a/inc/customizer-components/customizer-section-portfolio.php b/inc/customizer-components/customizer-section-portfolio.php index a095bf0..f2cd4bb 100644 --- a/inc/customizer-components/customizer-section-portfolio.php +++ b/inc/customizer-components/customizer-section-portfolio.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -141,7 +143,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_portfolio_desc', array( diff --git a/inc/customizer-components/customizer-section-sections.php b/inc/customizer-components/customizer-section-sections.php index debda6c..9258d2d 100644 --- a/inc/customizer-components/customizer-section-sections.php +++ b/inc/customizer-components/customizer-section-sections.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -29,7 +31,7 @@ ); $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( + new Customize_Repeatable_Control( $wp_customize, 'coletivo_section_order', array( diff --git a/inc/customizer-components/customizer-section-services.php b/inc/customizer-components/customizer-section-services.php index 4308876..7060907 100644 --- a/inc/customizer-components/customizer-section-services.php +++ b/inc/customizer-components/customizer-section-services.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -113,7 +115,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_services_desc', array( @@ -168,7 +170,7 @@ ); $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( + new Customize_Repeatable_Control( $wp_customize, 'coletivo_services', array( diff --git a/inc/customizer-components/customizer-section-social.php b/inc/customizer-components/customizer-section-social.php index 3989f5b..2f3d7cd 100644 --- a/inc/customizer-components/customizer-section-social.php +++ b/inc/customizer-components/customizer-section-social.php @@ -5,6 +5,9 @@ * @package Coletivo */ +namespace Coletivo; + +use WP_Customize_Color_Control; defined( 'ABSPATH' ) || exit; /** @@ -111,7 +114,7 @@ // Custom Message. $wp_customize->add_control( - new coletivo_Misc_Control( + new Misc_Control( $wp_customize, 'coletivo_social_footer_guide', array( @@ -132,7 +135,7 @@ ); $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( + new Customize_Repeatable_Control( $wp_customize, 'coletivo_social_profiles', array( diff --git a/inc/customizer-components/customizer-section-team.php b/inc/customizer-components/customizer-section-team.php index c443a87..444f03f 100644 --- a/inc/customizer-components/customizer-section-team.php +++ b/inc/customizer-components/customizer-section-team.php @@ -5,6 +5,8 @@ * @package Coletivo */ +namespace Coletivo; + defined( 'ABSPATH' ) || exit; /** @@ -113,7 +115,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_team_desc', array( @@ -168,7 +170,7 @@ ); $wp_customize->add_control( - new coletivo_Customize_Repeatable_Control( + new Customize_Repeatable_Control( $wp_customize, 'coletivo_team_members', array( diff --git a/inc/customizer-components/customizer-section-video-lightbox.php b/inc/customizer-components/customizer-section-video-lightbox.php index b8d3f0b..fb0de0b 100644 --- a/inc/customizer-components/customizer-section-video-lightbox.php +++ b/inc/customizer-components/customizer-section-video-lightbox.php @@ -5,6 +5,9 @@ * @package Coletivo */ +namespace Coletivo; + +use WP_Customize_Image_Control; defined( 'ABSPATH' ) || exit; /** @@ -95,7 +98,7 @@ ); $wp_customize->add_control( - new coletivo_Editor_Custom_Control( + new Editor_Custom_Control( $wp_customize, 'coletivo_videolightbox_title', array( From bb311612c393f2503fed01f670173cc51414c67d Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Wed, 12 May 2021 20:29:05 -0300 Subject: [PATCH 24/32] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20do=20Composer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Upgrade para versão 2.0.13 do Composer; - Atualização dos nomes de arquivos das Classes; - Atualização dos nomes das Classes; --- composer.json | 2 +- composer.lock | 18 ++ .../AlphaColorControl.php} | 2 +- .../CustomizeRepeatableControl.php} | 2 +- .../EditorCustomControl.php} | 2 +- .../EditorScripts.php} | 2 +- .../Metabox.php} | 0 .../MiscControl.php} | 2 +- .../TextareaCustomControl.php} | 2 +- .../customizer-section-contact.php | 8 +- .../customizer-section-featured-page.php | 2 +- .../customizer-section-features.php | 4 +- .../customizer-section-gallery.php | 2 +- .../customizer-section-hero.php | 10 +- .../customizer-section-news.php | 4 +- .../customizer-section-portfolio.php | 2 +- .../customizer-section-sections.php | 2 +- .../customizer-section-services.php | 4 +- .../customizer-section-social.php | 4 +- .../customizer-section-team.php | 4 +- .../customizer-section-video-lightbox.php | 2 +- inc/customizer-controls.php | 24 +- vendor/composer/ClassLoader.php | 38 ++- vendor/composer/InstalledVersions.php | 285 ++++++++++++++++++ vendor/composer/autoload_classmap.php | 7 +- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_real.php | 4 +- vendor/composer/autoload_static.php | 9 +- vendor/composer/installed.json | 6 +- vendor/composer/installed.php | 24 ++ 30 files changed, 417 insertions(+), 62 deletions(-) create mode 100644 composer.lock rename inc/{class-alpha-color-control.php => classes/AlphaColorControl.php} (98%) rename inc/{class-customize-repeatable-control.php => classes/CustomizeRepeatableControl.php} (99%) rename inc/{class-editor-custom-control.php => classes/EditorCustomControl.php} (95%) rename inc/{class-editor-scripts.php => classes/EditorScripts.php} (98%) rename inc/{class-metabox.php => classes/Metabox.php} (100%) rename inc/{class-misc-control.php => classes/MiscControl.php} (94%) rename inc/{class-textarea-custom-control.php => classes/TextareaCustomControl.php} (92%) create mode 100644 vendor/composer/InstalledVersions.php create mode 100644 vendor/composer/installed.php diff --git a/composer.json b/composer.json index 3ece44c..b0bc116 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "autoload": { "psr-4": { - "Coletivo\\": "inc/" + "Coletivo\\": "inc/class/" } } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..537a39b --- /dev/null +++ b/composer.lock @@ -0,0 +1,18 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "99d9679e44819c8da9fc80306e761a9b", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/inc/class-alpha-color-control.php b/inc/classes/AlphaColorControl.php similarity index 98% rename from inc/class-alpha-color-control.php rename to inc/classes/AlphaColorControl.php index 0589091..1989f1d 100644 --- a/inc/class-alpha-color-control.php +++ b/inc/classes/AlphaColorControl.php @@ -34,7 +34,7 @@ * You should have received a copy of the GNU General Public License * along with this Alpha Color Picker. If not, see . */ -class Alpha_Color_Control extends WP_Customize_Control { +class AlphaColorControl extends WP_Customize_Control { /** * Official control name. diff --git a/inc/class-customize-repeatable-control.php b/inc/classes/CustomizeRepeatableControl.php similarity index 99% rename from inc/class-customize-repeatable-control.php rename to inc/classes/CustomizeRepeatableControl.php index a43e964..422b907 100644 --- a/inc/class-customize-repeatable-control.php +++ b/inc/classes/CustomizeRepeatableControl.php @@ -20,7 +20,7 @@ * @since 1.0.0 * @access public */ -class Customize_Repeatable_Control extends WP_Customize_Control { +class CustomizeRepeatableControl extends WP_Customize_Control { /** * The type of customize control being rendered. diff --git a/inc/class-editor-custom-control.php b/inc/classes/EditorCustomControl.php similarity index 95% rename from inc/class-editor-custom-control.php rename to inc/classes/EditorCustomControl.php index 7b0e35f..4e35e3f 100644 --- a/inc/class-editor-custom-control.php +++ b/inc/classes/EditorCustomControl.php @@ -17,7 +17,7 @@ /** * Editor Custom Control Class */ -class Editor_Custom_Control extends WP_Customize_Control { +class EditorCustomControl extends WP_Customize_Control { /** * The type of customize control being rendered. * diff --git a/inc/class-editor-scripts.php b/inc/classes/EditorScripts.php similarity index 98% rename from inc/class-editor-scripts.php rename to inc/classes/EditorScripts.php index 0889b86..bd766f9 100644 --- a/inc/class-editor-scripts.php +++ b/inc/classes/EditorScripts.php @@ -15,7 +15,7 @@ /** * Editor Script Class */ -class Editor_Scripts { +class EditorScripts { /** * Init function diff --git a/inc/class-metabox.php b/inc/classes/Metabox.php similarity index 100% rename from inc/class-metabox.php rename to inc/classes/Metabox.php diff --git a/inc/class-misc-control.php b/inc/classes/MiscControl.php similarity index 94% rename from inc/class-misc-control.php rename to inc/classes/MiscControl.php index d3f877e..5dff3d7 100644 --- a/inc/class-misc-control.php +++ b/inc/classes/MiscControl.php @@ -17,7 +17,7 @@ /** * Misc Control Class */ -class Misc_Control extends WP_Customize_Control { +class MiscControl extends WP_Customize_Control { /** * Settings diff --git a/inc/class-textarea-custom-control.php b/inc/classes/TextareaCustomControl.php similarity index 92% rename from inc/class-textarea-custom-control.php rename to inc/classes/TextareaCustomControl.php index 2464046..6172ea9 100644 --- a/inc/class-textarea-custom-control.php +++ b/inc/classes/TextareaCustomControl.php @@ -17,7 +17,7 @@ /** * Text Area Custom Control Class */ -class Textarea_Custom_Control extends WP_Customize_Control { +class TextareaCustomControl extends WP_Customize_Control { /** * Render the description and title for the sections */ diff --git a/inc/customizer-components/customizer-section-contact.php b/inc/customizer-components/customizer-section-contact.php index efbd1dd..039e2e4 100644 --- a/inc/customizer-components/customizer-section-contact.php +++ b/inc/customizer-components/customizer-section-contact.php @@ -134,7 +134,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_contact_desc', array( @@ -164,7 +164,7 @@ ); $wp_customize->add_control( - new Misc_Control( + new MiscControl( $wp_customize, 'coletivo_contact_cf7_guide', array( @@ -202,7 +202,7 @@ ); $wp_customize->add_control( - new Misc_Control( + new MiscControl( $wp_customize, 'coletivo_contact_text_hr', array( @@ -239,7 +239,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_contact_text', array( diff --git a/inc/customizer-components/customizer-section-featured-page.php b/inc/customizer-components/customizer-section-featured-page.php index b547a00..f13574e 100644 --- a/inc/customizer-components/customizer-section-featured-page.php +++ b/inc/customizer-components/customizer-section-featured-page.php @@ -170,7 +170,7 @@ ); $wp_customize->add_control( - new Alpha_Color_Control( + new AlphaColorControl( $wp_customize, 'coletivo_featuredpage_overlay_color', array( diff --git a/inc/customizer-components/customizer-section-features.php b/inc/customizer-components/customizer-section-features.php index deb92af..4398696 100644 --- a/inc/customizer-components/customizer-section-features.php +++ b/inc/customizer-components/customizer-section-features.php @@ -115,7 +115,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_features_desc', array( @@ -170,7 +170,7 @@ ); $wp_customize->add_control( - new Customize_Repeatable_Control( + new CustomizeRepeatableControl( $wp_customize, 'coletivo_features_boxes', array( diff --git a/inc/customizer-components/customizer-section-gallery.php b/inc/customizer-components/customizer-section-gallery.php index c216255..7c4c413 100644 --- a/inc/customizer-components/customizer-section-gallery.php +++ b/inc/customizer-components/customizer-section-gallery.php @@ -115,7 +115,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_gallery_desc', array( diff --git a/inc/customizer-components/customizer-section-hero.php b/inc/customizer-components/customizer-section-hero.php index 3153edf..094b9b7 100644 --- a/inc/customizer-components/customizer-section-hero.php +++ b/inc/customizer-components/customizer-section-hero.php @@ -174,7 +174,7 @@ ); $wp_customize->add_control( - new Customize_Repeatable_Control( + new CustomizeRepeatableControl( $wp_customize, 'coletivo_hero_images', array( @@ -209,7 +209,7 @@ ); $wp_customize->add_control( - new Alpha_Color_Control( + new AlphaColorControl( $wp_customize, 'coletivo_hero_overlay_color', array( @@ -286,7 +286,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_hcl1_largetext', array( @@ -307,7 +307,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_hcl1_smalltext', array( @@ -455,7 +455,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_hcl2_content', array( diff --git a/inc/customizer-components/customizer-section-news.php b/inc/customizer-components/customizer-section-news.php index 9e19bf1..a8eae71 100644 --- a/inc/customizer-components/customizer-section-news.php +++ b/inc/customizer-components/customizer-section-news.php @@ -115,7 +115,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_news_desc', array( @@ -135,7 +135,7 @@ ); $wp_customize->add_control( - new Misc_Control( + new MiscControl( $wp_customize, 'coletivo_news_settings_hr', array( diff --git a/inc/customizer-components/customizer-section-portfolio.php b/inc/customizer-components/customizer-section-portfolio.php index f2cd4bb..b04228a 100644 --- a/inc/customizer-components/customizer-section-portfolio.php +++ b/inc/customizer-components/customizer-section-portfolio.php @@ -143,7 +143,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_portfolio_desc', array( diff --git a/inc/customizer-components/customizer-section-sections.php b/inc/customizer-components/customizer-section-sections.php index 9258d2d..e3e91d1 100644 --- a/inc/customizer-components/customizer-section-sections.php +++ b/inc/customizer-components/customizer-section-sections.php @@ -31,7 +31,7 @@ ); $wp_customize->add_control( - new Customize_Repeatable_Control( + new CustomizeRepeatableControl( $wp_customize, 'coletivo_section_order', array( diff --git a/inc/customizer-components/customizer-section-services.php b/inc/customizer-components/customizer-section-services.php index 7060907..dec0219 100644 --- a/inc/customizer-components/customizer-section-services.php +++ b/inc/customizer-components/customizer-section-services.php @@ -115,7 +115,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_services_desc', array( @@ -170,7 +170,7 @@ ); $wp_customize->add_control( - new Customize_Repeatable_Control( + new CustomizeRepeatableControl( $wp_customize, 'coletivo_services', array( diff --git a/inc/customizer-components/customizer-section-social.php b/inc/customizer-components/customizer-section-social.php index 2f3d7cd..4b46527 100644 --- a/inc/customizer-components/customizer-section-social.php +++ b/inc/customizer-components/customizer-section-social.php @@ -114,7 +114,7 @@ // Custom Message. $wp_customize->add_control( - new Misc_Control( + new MiscControl( $wp_customize, 'coletivo_social_footer_guide', array( @@ -135,7 +135,7 @@ ); $wp_customize->add_control( - new Customize_Repeatable_Control( + new CustomizeRepeatableControl( $wp_customize, 'coletivo_social_profiles', array( diff --git a/inc/customizer-components/customizer-section-team.php b/inc/customizer-components/customizer-section-team.php index 444f03f..7fade31 100644 --- a/inc/customizer-components/customizer-section-team.php +++ b/inc/customizer-components/customizer-section-team.php @@ -115,7 +115,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_team_desc', array( @@ -170,7 +170,7 @@ ); $wp_customize->add_control( - new Customize_Repeatable_Control( + new CustomizeRepeatableControl( $wp_customize, 'coletivo_team_members', array( diff --git a/inc/customizer-components/customizer-section-video-lightbox.php b/inc/customizer-components/customizer-section-video-lightbox.php index fb0de0b..b047877 100644 --- a/inc/customizer-components/customizer-section-video-lightbox.php +++ b/inc/customizer-components/customizer-section-video-lightbox.php @@ -98,7 +98,7 @@ ); $wp_customize->add_control( - new Editor_Custom_Control( + new EditorCustomControl( $wp_customize, 'coletivo_videolightbox_title', array( diff --git a/inc/customizer-controls.php b/inc/customizer-controls.php index 7f2bf43..5593fb7 100644 --- a/inc/customizer-controls.php +++ b/inc/customizer-controls.php @@ -12,12 +12,12 @@ require get_template_directory() . '/vendor/autoload.php'; } -if ( ! class_exists( 'Misc_Control' ) ) { - require_once get_template_directory() . '/inc/class-misc-control.php'; +if ( ! class_exists( 'MiscControl' ) ) { + require_once get_template_directory() . '/inc/classes/MiscControl.php'; } -if ( ! class_exists( 'Textarea_Custom_Control' ) ) { - require_once get_template_directory() . '/inc/class-textarea-custom-control.php'; +if ( ! class_exists( 'TextareaCustomControl' ) ) { + require_once get_template_directory() . '/inc/classes/TextareaCustomControl.php'; } if ( ! function_exists( 'coletivo_sanitize_checkbox' ) ) { @@ -199,16 +199,16 @@ function coletivo_sanitize_repeatable_data_field( $input, $setting ) { return $data; } -if ( ! class_exists( 'Editor_Custom_Control' ) ) { - require_once get_template_directory() . '/inc/class-editor-custom-control.php'; +if ( ! class_exists( 'EditorCustomControl' ) ) { + require_once get_template_directory() . '/inc/classes/EditorCustomControl.php'; } -if ( ! class_exists( 'Alpha_Color_Control' ) ) { - require_once get_template_directory() . '/inc/class-alpha-color-control.php'; +if ( ! class_exists( 'AlphaColorControl' ) ) { + require_once get_template_directory() . '/inc/classes/AlphaColorControl.php'; } -if ( ! class_exists( 'Customize_Repeatable_Control' ) ) { - require_once get_template_directory() . '/inc/class-customize-repeatable-control.php'; +if ( ! class_exists( 'CustomizeRepeatableControl' ) ) { + require_once get_template_directory() . '/inc/classes/CustomizeRepeatableControl.php'; } /** @@ -227,8 +227,8 @@ function coletivo_enqueue_editor() { } } -if ( ! class_exists( 'Editor_Scripts' ) ) { - require_once get_template_directory() . '/inc/class-editor-scripts.php'; +if ( ! class_exists( 'EditorScripts' ) ) { + require_once get_template_directory() . '/inc/classes/EditorScripts.php'; } /** diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 03b9bb9..247294d 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -37,11 +37,13 @@ * * @author Fabien Potencier * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { + private $vendorDir; + // PSR-4 private $prefixLengthsPsr4 = array(); private $prefixDirsPsr4 = array(); @@ -57,6 +59,13 @@ class ClassLoader private $missingClasses = array(); private $apcuPrefix; + private static $registeredLoaders = array(); + + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -300,6 +309,17 @@ public function getApcuPrefix() public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } } /** @@ -308,6 +328,10 @@ public function register($prepend = false) public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } } /** @@ -367,6 +391,16 @@ public function findFile($class) return $file; } + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + private function findFileWithExtension($class, $ext) { // PSR-4 lookup diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 0000000..9f4bf2e --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,285 @@ + + array ( + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'aliases' => + array ( + ), + 'reference' => 'a724aa3ad9309d11e0152aa673d8aed0fb30b221', + 'name' => 'redelivre/coletivo', + ), + 'versions' => + array ( + 'redelivre/coletivo' => + array ( + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'aliases' => + array ( + ), + 'reference' => 'a724aa3ad9309d11e0152aa673d8aed0fb30b221', + ), + ), +); +private static $canGetVendors; +private static $installedByVendor = array(); + + + + + + + +public static function getInstalledPackages() +{ +$packages = array(); +foreach (self::getInstalled() as $installed) { +$packages[] = array_keys($installed['versions']); +} + +if (1 === \count($packages)) { +return $packages[0]; +} + +return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); +} + + + + + + + + + +public static function isInstalled($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (isset($installed['versions'][$packageName])) { +return true; +} +} + +return false; +} + + + + + + + + + + + + + + +public static function satisfies(VersionParser $parser, $packageName, $constraint) +{ +$constraint = $parser->parseConstraints($constraint); +$provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + +return $provided->matches($constraint); +} + + + + + + + + + + +public static function getVersionRanges($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (!isset($installed['versions'][$packageName])) { +continue; +} + +$ranges = array(); +if (isset($installed['versions'][$packageName]['pretty_version'])) { +$ranges[] = $installed['versions'][$packageName]['pretty_version']; +} +if (array_key_exists('aliases', $installed['versions'][$packageName])) { +$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); +} +if (array_key_exists('replaced', $installed['versions'][$packageName])) { +$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); +} +if (array_key_exists('provided', $installed['versions'][$packageName])) { +$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); +} + +return implode(' || ', $ranges); +} + +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + + + + + +public static function getVersion($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (!isset($installed['versions'][$packageName])) { +continue; +} + +if (!isset($installed['versions'][$packageName]['version'])) { +return null; +} + +return $installed['versions'][$packageName]['version']; +} + +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + + + + + +public static function getPrettyVersion($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (!isset($installed['versions'][$packageName])) { +continue; +} + +if (!isset($installed['versions'][$packageName]['pretty_version'])) { +return null; +} + +return $installed['versions'][$packageName]['pretty_version']; +} + +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + + + + + +public static function getReference($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (!isset($installed['versions'][$packageName])) { +continue; +} + +if (!isset($installed['versions'][$packageName]['reference'])) { +return null; +} + +return $installed['versions'][$packageName]['reference']; +} + +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + + + + + +public static function getRootPackage() +{ +$installed = self::getInstalled(); + +return $installed[0]['root']; +} + + + + + + + +public static function getRawData() +{ +return self::$installed; +} + + + + + + + + + + + + + + + + + + + +public static function reload($data) +{ +self::$installed = $data; +self::$installedByVendor = array(); +} + + + + + +private static function getInstalled() +{ +if (null === self::$canGetVendors) { +self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); +} + +$installed = array(); + +if (self::$canGetVendors) { +foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { +if (isset(self::$installedByVendor[$vendorDir])) { +$installed[] = self::$installedByVendor[$vendorDir]; +} elseif (is_file($vendorDir.'/composer/installed.php')) { +$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; +} +} +} + +$installed[] = self::$installed; + +return $installed; +} +} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index b8db740..b26f1b1 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,10 +6,5 @@ $baseDir = dirname($vendorDir); return array( - 'Coletivo\\Alpha_Color_Control' => $baseDir . '/inc/class-alpha-color-control.php', - 'Coletivo\\Customize_Repeatable_Control' => $baseDir . '/inc/class-customize-repeatable-control.php', - 'Coletivo\\Editor_Custom_Control' => $baseDir . '/inc/class-editor-custom-control.php', - 'Coletivo\\Editor_Scripts' => $baseDir . '/inc/class-editor-scripts.php', - 'Coletivo\\Misc_Control' => $baseDir . '/inc/class-misc-control.php', - 'Coletivo\\Textarea_Custom_Control' => $baseDir . '/inc/class-textarea-custom-control.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 2b66a3e..4fa3b94 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,5 +6,5 @@ $baseDir = dirname($vendorDir); return array( - 'Coletivo\\' => array($baseDir . '/inc'), + 'Coletivo\\' => array($baseDir . '/inc/class'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 9d88fbc..124384e 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -23,12 +23,12 @@ public static function getLoader() } spl_autoload_register(array('ComposerAutoloaderInitee95b5323bc168289d8c536d1a93cb7f', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); spl_autoload_unregister(array('ComposerAutoloaderInitee95b5323bc168289d8c536d1a93cb7f', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; + require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInitee95b5323bc168289d8c536d1a93cb7f::getInitializer($loader)); } else { diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index b8bab32..37ecee9 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -16,17 +16,12 @@ class ComposerStaticInitee95b5323bc168289d8c536d1a93cb7f public static $prefixDirsPsr4 = array ( 'Coletivo\\' => array ( - 0 => __DIR__ . '/../..' . '/inc', + 0 => __DIR__ . '/../..' . '/inc/class', ), ); public static $classMap = array ( - 'Coletivo\\Alpha_Color_Control' => __DIR__ . '/../..' . '/inc/class-alpha-color-control.php', - 'Coletivo\\Customize_Repeatable_Control' => __DIR__ . '/../..' . '/inc/class-customize-repeatable-control.php', - 'Coletivo\\Editor_Custom_Control' => __DIR__ . '/../..' . '/inc/class-editor-custom-control.php', - 'Coletivo\\Editor_Scripts' => __DIR__ . '/../..' . '/inc/class-editor-scripts.php', - 'Coletivo\\Misc_Control' => __DIR__ . '/../..' . '/inc/class-misc-control.php', - 'Coletivo\\Textarea_Custom_Control' => __DIR__ . '/../..' . '/inc/class-textarea-custom-control.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index fe51488..87fda74 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1 +1,5 @@ -[] +{ + "packages": [], + "dev": true, + "dev-package-names": [] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 0000000..831bd56 --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,24 @@ + + array ( + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'aliases' => + array ( + ), + 'reference' => 'a724aa3ad9309d11e0152aa673d8aed0fb30b221', + 'name' => 'redelivre/coletivo', + ), + 'versions' => + array ( + 'redelivre/coletivo' => + array ( + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'aliases' => + array ( + ), + 'reference' => 'a724aa3ad9309d11e0152aa673d8aed0fb30b221', + ), + ), +); From dcbdb746afdeba131075fe742f4a52dfee7c0c4b Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Fri, 14 May 2021 13:46:16 -0300 Subject: [PATCH 25/32] =?UTF-8?q?Altera=C3=A7=C3=A3o=20do=20namespace=20e?= =?UTF-8?q?=20atualiza=C3=A7=C3=A3o=20do=20Composer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 +- inc/classes/AlphaColorControl.php | 2 +- inc/classes/ControlScripts.php | 48 +++++++++++++++++++ inc/classes/CustomizeRepeatableControl.php | 2 +- inc/classes/EditorCustomControl.php | 2 +- inc/classes/EditorScripts.php | 2 +- inc/classes/MiscControl.php | 2 +- inc/classes/{Metabox.php => Odin_Metabox.php} | 9 +++- inc/classes/TextareaCustomControl.php | 2 +- .../customizer-section-contact.php | 2 +- .../customizer-section-featured-page.php | 2 +- .../customizer-section-features.php | 2 +- .../customizer-section-gallery.php | 2 +- .../customizer-section-hero.php | 2 +- .../customizer-section-news.php | 2 +- .../customizer-section-portfolio.php | 2 +- .../customizer-section-sections.php | 2 +- .../customizer-section-services.php | 2 +- .../customizer-section-social.php | 2 +- .../customizer-section-team.php | 2 +- .../customizer-section-video-lightbox.php | 2 +- inc/customizer-controls.php | 25 +--------- inc/customizer-selective-refresh.php | 4 +- inc/customizer-update-fields.php | 4 +- inc/customizer.php | 2 +- vendor/composer/autoload_classmap.php | 8 ++++ vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_static.php | 16 +++++-- 28 files changed, 103 insertions(+), 53 deletions(-) create mode 100644 inc/classes/ControlScripts.php rename inc/classes/{Metabox.php => Odin_Metabox.php} (99%) diff --git a/composer.json b/composer.json index b0bc116..dbf14fc 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "autoload": { "psr-4": { - "Coletivo\\": "inc/class/" + "RedeLivre\\Coletivo\\": "inc/classes/" } } } diff --git a/inc/classes/AlphaColorControl.php b/inc/classes/AlphaColorControl.php index 1989f1d..7f7dcee 100644 --- a/inc/classes/AlphaColorControl.php +++ b/inc/classes/AlphaColorControl.php @@ -7,7 +7,7 @@ declare(strict_types = 1); -namespace Coletivo; +namespace RedeLivre\Coletivo; use WP_Customize_Control; diff --git a/inc/classes/ControlScripts.php b/inc/classes/ControlScripts.php new file mode 100644 index 0000000..989540b --- /dev/null +++ b/inc/classes/ControlScripts.php @@ -0,0 +1,48 @@ + __( 'Section: ', 'coletivo' ) ) ); + } + +} diff --git a/inc/classes/CustomizeRepeatableControl.php b/inc/classes/CustomizeRepeatableControl.php index 422b907..c1e08dd 100644 --- a/inc/classes/CustomizeRepeatableControl.php +++ b/inc/classes/CustomizeRepeatableControl.php @@ -7,7 +7,7 @@ declare(strict_types = 1); -namespace Coletivo; +namespace RedeLivre\Coletivo; use WP_Customize_Control; diff --git a/inc/classes/EditorCustomControl.php b/inc/classes/EditorCustomControl.php index 4e35e3f..439daaf 100644 --- a/inc/classes/EditorCustomControl.php +++ b/inc/classes/EditorCustomControl.php @@ -7,7 +7,7 @@ declare(strict_types = 1); -namespace Coletivo; +namespace RedeLivre\Coletivo; use WP_Customize_Control; diff --git a/inc/classes/EditorScripts.php b/inc/classes/EditorScripts.php index bd766f9..8abed22 100644 --- a/inc/classes/EditorScripts.php +++ b/inc/classes/EditorScripts.php @@ -7,7 +7,7 @@ declare(strict_types = 1); -namespace Coletivo; +namespace RedeLivre\Coletivo; // Prevents dipostt access. defined( 'ABSPATH' ) || exit; diff --git a/inc/classes/MiscControl.php b/inc/classes/MiscControl.php index 5dff3d7..d816962 100644 --- a/inc/classes/MiscControl.php +++ b/inc/classes/MiscControl.php @@ -7,7 +7,7 @@ declare(strict_types = 1); -namespace Coletivo; +namespace RedeLivre\Coletivo; use WP_Customize_Control; diff --git a/inc/classes/Metabox.php b/inc/classes/Odin_Metabox.php similarity index 99% rename from inc/classes/Metabox.php rename to inc/classes/Odin_Metabox.php index 2cb7e83..134e7b4 100644 --- a/inc/classes/Metabox.php +++ b/inc/classes/Odin_Metabox.php @@ -2,9 +2,16 @@ /** * Class Metabox * - * @package Coletivo + * @package Coletivo/Classes */ +declare(strict_types = 1); + +namespace RedeLivre\Coletivo; + +// Prevents dipostt access. +defined( 'ABSPATH' ) || exit; + /** * Odin_Metabox class. * diff --git a/inc/classes/TextareaCustomControl.php b/inc/classes/TextareaCustomControl.php index 6172ea9..cd0d357 100644 --- a/inc/classes/TextareaCustomControl.php +++ b/inc/classes/TextareaCustomControl.php @@ -7,7 +7,7 @@ declare(strict_types = 1); -namespace Coletivo; +namespace RedeLivre\Coletivo; use WP_Customize_Control; diff --git a/inc/customizer-components/customizer-section-contact.php b/inc/customizer-components/customizer-section-contact.php index 039e2e4..f50620e 100644 --- a/inc/customizer-components/customizer-section-contact.php +++ b/inc/customizer-components/customizer-section-contact.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-featured-page.php b/inc/customizer-components/customizer-section-featured-page.php index f13574e..b872d82 100644 --- a/inc/customizer-components/customizer-section-featured-page.php +++ b/inc/customizer-components/customizer-section-featured-page.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-features.php b/inc/customizer-components/customizer-section-features.php index 4398696..de0578c 100644 --- a/inc/customizer-components/customizer-section-features.php +++ b/inc/customizer-components/customizer-section-features.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-gallery.php b/inc/customizer-components/customizer-section-gallery.php index 7c4c413..618a712 100644 --- a/inc/customizer-components/customizer-section-gallery.php +++ b/inc/customizer-components/customizer-section-gallery.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-hero.php b/inc/customizer-components/customizer-section-hero.php index 094b9b7..4e674b8 100644 --- a/inc/customizer-components/customizer-section-hero.php +++ b/inc/customizer-components/customizer-section-hero.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-news.php b/inc/customizer-components/customizer-section-news.php index a8eae71..9fd1172 100644 --- a/inc/customizer-components/customizer-section-news.php +++ b/inc/customizer-components/customizer-section-news.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-portfolio.php b/inc/customizer-components/customizer-section-portfolio.php index b04228a..08167a4 100644 --- a/inc/customizer-components/customizer-section-portfolio.php +++ b/inc/customizer-components/customizer-section-portfolio.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-sections.php b/inc/customizer-components/customizer-section-sections.php index e3e91d1..7ab98f2 100644 --- a/inc/customizer-components/customizer-section-sections.php +++ b/inc/customizer-components/customizer-section-sections.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-services.php b/inc/customizer-components/customizer-section-services.php index dec0219..6184758 100644 --- a/inc/customizer-components/customizer-section-services.php +++ b/inc/customizer-components/customizer-section-services.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-social.php b/inc/customizer-components/customizer-section-social.php index 4b46527..a7ed64a 100644 --- a/inc/customizer-components/customizer-section-social.php +++ b/inc/customizer-components/customizer-section-social.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; use WP_Customize_Color_Control; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-team.php b/inc/customizer-components/customizer-section-team.php index 7fade31..7e688f7 100644 --- a/inc/customizer-components/customizer-section-team.php +++ b/inc/customizer-components/customizer-section-team.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-components/customizer-section-video-lightbox.php b/inc/customizer-components/customizer-section-video-lightbox.php index b047877..78da61e 100644 --- a/inc/customizer-components/customizer-section-video-lightbox.php +++ b/inc/customizer-components/customizer-section-video-lightbox.php @@ -5,7 +5,7 @@ * @package Coletivo */ -namespace Coletivo; +namespace RedeLivre\Coletivo; use WP_Customize_Image_Control; defined( 'ABSPATH' ) || exit; diff --git a/inc/customizer-controls.php b/inc/customizer-controls.php index 5593fb7..3393c2c 100644 --- a/inc/customizer-controls.php +++ b/inc/customizer-controls.php @@ -5,8 +5,6 @@ * @package Coletivo */ -namespace Coletivo; - /* Autoload */ if ( version_compare( PHP_VERSION, '5.6.0', '>=' ) ) { require get_template_directory() . '/vendor/autoload.php'; @@ -231,25 +229,6 @@ function coletivo_enqueue_editor() { require_once get_template_directory() . '/inc/classes/EditorScripts.php'; } -/** - * Customizer control scripts - * - * @return void - */ -function coletivo_customizer_control_scripts() { - wp_enqueue_media(); - wp_enqueue_script( 'jquery-ui-sortable' ); - wp_enqueue_script( 'wp-color-picker' ); - wp_enqueue_style( 'wp-color-picker' ); - - wp_enqueue_script( 'coletivo-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-controls', 'wp-color-picker' ), VERSION, true ); - wp_enqueue_style( 'coletivo-customizer', get_template_directory_uri() . '/assets/css/customizer.css', false, VERSION ); - wp_localize_script( 'coletivo-customizer', 'coletivo_customizer', array( 'before_section_title' => __( 'Section: ', 'coletivo' ) ) ); -} - -/** - * Init function - */ -function init() { - add_action( 'customize_controls_enqueue_scripts', 'coletivo_customizer_control_scripts', 99 ); +if ( ! class_exists( 'ControlScripts' ) ) { + require_once get_template_directory() . '/inc/classes/ControlScripts.php'; } diff --git a/inc/customizer-selective-refresh.php b/inc/customizer-selective-refresh.php index e565b61..07998fc 100644 --- a/inc/customizer-selective-refresh.php +++ b/inc/customizer-selective-refresh.php @@ -30,8 +30,8 @@ function coletivo_customizer_load_template( $template_names ) { $located = get_stylesheet_directory() . '/' . $template_name; break; - } elseif ( defined( 'Coletivo_PLUS_PATH' ) && file_exists( Coletivo_PLUS_PATH . $template_name ) ) { // Check part in the plugin. - $located = Coletivo_PLUS_PATH . $template_name; + } elseif ( defined( 'coletivo_PLUS_PATH' ) && file_exists( coletivo_PLUS_PATH . $template_name ) ) { // Check part in the plugin. + $located = coletivo_PLUS_PATH . $template_name; break; } elseif ( file_exists( get_template_directory() . '/' . $template_name ) ) { // current_theme. $located = get_template_directory() . '/' . $template_name; diff --git a/inc/customizer-update-fields.php b/inc/customizer-update-fields.php index 8bb8150..be21d80 100644 --- a/inc/customizer-update-fields.php +++ b/inc/customizer-update-fields.php @@ -41,7 +41,7 @@ public function update_theme_mod() { if ( 'true' === get_option( 'tema_coletivo_updated_customizer', 'false' ) ) { return; } - $customizer_fields = get_option( 'theme_mods_coletivo' ); + $customizer_fields = get_option( 'theme_mods_tema-coletivo' ); if ( is_array( $customizer_fields ) ) { foreach ( $customizer_fields as $key => $value ) { @@ -52,7 +52,7 @@ public function update_theme_mod() { $customizer_fields[ $new_key ] = $value; unset( $customizer_fields[ $key ] ); } - update_option( 'theme_mods_coletivo', $customizer_fields ); + update_option( 'theme_mods_tema-coletivo', $customizer_fields ); update_option( 'tema_coletivo_updated_customizer', 'true' ); } } diff --git a/inc/customizer.php b/inc/customizer.php index 36192e0..df66718 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -250,7 +250,7 @@ function coletivo_customize_js_settings() { 'coletivo_customizer_settings', array( 'number_action' => $number_action, - 'is_plus_activated' => class_exists( 'coletivo_PLUS' ) ? 'y' : 'n', + 'is_plus_activated' => class_exists( 'coletivo_PLus' ) ? 'y' : 'n', 'action_url' => admin_url( 'themes.php?page=ft_coletivo&tab=actions_required' ), ) ); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index b26f1b1..07b7397 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -7,4 +7,12 @@ return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'RedeLivre\\Coletivo\\AlphaColorControl' => $baseDir . '/inc/classes/AlphaColorControl.php', + 'RedeLivre\\Coletivo\\ControlScripts' => $baseDir . '/inc/classes/ControlScripts.php', + 'RedeLivre\\Coletivo\\CustomizeRepeatableControl' => $baseDir . '/inc/classes/CustomizeRepeatableControl.php', + 'RedeLivre\\Coletivo\\EditorCustomControl' => $baseDir . '/inc/classes/EditorCustomControl.php', + 'RedeLivre\\Coletivo\\EditorScripts' => $baseDir . '/inc/classes/EditorScripts.php', + 'RedeLivre\\Coletivo\\MiscControl' => $baseDir . '/inc/classes/MiscControl.php', + 'RedeLivre\\Coletivo\\Odin_Metabox' => $baseDir . '/inc/classes/Odin_Metabox.php', + 'RedeLivre\\Coletivo\\TextareaCustomControl' => $baseDir . '/inc/classes/TextareaCustomControl.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 4fa3b94..58ae0ba 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,5 +6,5 @@ $baseDir = dirname($vendorDir); return array( - 'Coletivo\\' => array($baseDir . '/inc/class'), + 'RedeLivre\\Coletivo\\' => array($baseDir . '/inc/classes'), ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 37ecee9..ab28dd3 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -7,21 +7,29 @@ class ComposerStaticInitee95b5323bc168289d8c536d1a93cb7f { public static $prefixLengthsPsr4 = array ( - 'C' => + 'R' => array ( - 'Coletivo\\' => 9, + 'RedeLivre\\Coletivo\\' => 19, ), ); public static $prefixDirsPsr4 = array ( - 'Coletivo\\' => + 'RedeLivre\\Coletivo\\' => array ( - 0 => __DIR__ . '/../..' . '/inc/class', + 0 => __DIR__ . '/../..' . '/inc/classes', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'RedeLivre\\Coletivo\\AlphaColorControl' => __DIR__ . '/../..' . '/inc/classes/AlphaColorControl.php', + 'RedeLivre\\Coletivo\\ControlScripts' => __DIR__ . '/../..' . '/inc/classes/ControlScripts.php', + 'RedeLivre\\Coletivo\\CustomizeRepeatableControl' => __DIR__ . '/../..' . '/inc/classes/CustomizeRepeatableControl.php', + 'RedeLivre\\Coletivo\\EditorCustomControl' => __DIR__ . '/../..' . '/inc/classes/EditorCustomControl.php', + 'RedeLivre\\Coletivo\\EditorScripts' => __DIR__ . '/../..' . '/inc/classes/EditorScripts.php', + 'RedeLivre\\Coletivo\\MiscControl' => __DIR__ . '/../..' . '/inc/classes/MiscControl.php', + 'RedeLivre\\Coletivo\\Odin_Metabox' => __DIR__ . '/../..' . '/inc/classes/Odin_Metabox.php', + 'RedeLivre\\Coletivo\\TextareaCustomControl' => __DIR__ . '/../..' . '/inc/classes/TextareaCustomControl.php', ); public static function getInitializer(ClassLoader $loader) From 41564e3f7acf78b36123abad8051e1cad6a9e436 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sat, 15 May 2021 19:50:57 -0300 Subject: [PATCH 26/32] FIx: Carregamento do Control-Scripts --- inc/classes/ControlScripts.php | 48 ---------------------------------- inc/customizer-controls.php | 20 ++++++++++++-- 2 files changed, 18 insertions(+), 50 deletions(-) delete mode 100644 inc/classes/ControlScripts.php diff --git a/inc/classes/ControlScripts.php b/inc/classes/ControlScripts.php deleted file mode 100644 index 989540b..0000000 --- a/inc/classes/ControlScripts.php +++ /dev/null @@ -1,48 +0,0 @@ - __( 'Section: ', 'coletivo' ) ) ); - } - -} diff --git a/inc/customizer-controls.php b/inc/customizer-controls.php index 3393c2c..88673d1 100644 --- a/inc/customizer-controls.php +++ b/inc/customizer-controls.php @@ -229,6 +229,22 @@ function coletivo_enqueue_editor() { require_once get_template_directory() . '/inc/classes/EditorScripts.php'; } -if ( ! class_exists( 'ControlScripts' ) ) { - require_once get_template_directory() . '/inc/classes/ControlScripts.php'; +/** + * Customizer control scripts + * + * @since 1.7.0 + * @access public + * + * @return void + */ +function customizer_control_scripts() { + wp_enqueue_media(); + wp_enqueue_script( 'jquery-ui-sortable' ); + wp_enqueue_script( 'wp-color-picker' ); + wp_enqueue_style( 'wp-color-picker' ); + + wp_enqueue_script( 'coletivo-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-controls', 'wp-color-picker' ), VERSION, true ); + wp_enqueue_style( 'coletivo-customizer', get_template_directory_uri() . '/assets/css/customizer.css', false, VERSION ); + wp_add_inline_script( 'coletivo-customizer', 'coletivo_customizer', array( 'before_section_title' => __( 'Section: ', 'coletivo' ) ) ); } +add_action( 'customize_controls_enqueue_scripts', 'customizer_control_scripts', 99 ); From 7d9fca83eef0e2c649821f6313c6e9928b5eaaa8 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Sat, 15 May 2021 20:19:53 -0300 Subject: [PATCH 27/32] =?UTF-8?q?Remo=C3=A7=C3=A3o=20de=20trecho=20de=20c?= =?UTF-8?q?=C3=B3digo=20duplicado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/customizer-controls.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/inc/customizer-controls.php b/inc/customizer-controls.php index 88673d1..b621ab9 100644 --- a/inc/customizer-controls.php +++ b/inc/customizer-controls.php @@ -209,22 +209,6 @@ function coletivo_sanitize_repeatable_data_field( $input, $setting ) { require_once get_template_directory() . '/inc/classes/CustomizeRepeatableControl.php'; } -/** - * Enqueue editor - * - * @return void - */ -function coletivo_enqueue_editor() { - if ( ! isset( $GLOBALS['__wp_mce_editor__'] ) || ! $GLOBALS['__wp_mce_editor__'] ) { - $GLOBALS['__wp_mce_editor__'] = true; - ?> - - Date: Tue, 18 May 2021 20:36:54 -0300 Subject: [PATCH 28/32] =?UTF-8?q?Refatora=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Transferência de todas as funções de sanitização para o mesmo arquivo; - Reposicionamento de Hooks após as funções; - Retorno do echo na linha 56 do arquivo template-tags.php; - Retorno da função wp_localize_script no arquivo customizer.php. --- inc/customizer-controls.php | 181 +-------------------------------- inc/customizer.php | 195 +++++++++++++++++++++++++++++++++--- inc/template-tags.php | 13 +-- 3 files changed, 184 insertions(+), 205 deletions(-) diff --git a/inc/customizer-controls.php b/inc/customizer-controls.php index b621ab9..dba1ce0 100644 --- a/inc/customizer-controls.php +++ b/inc/customizer-controls.php @@ -18,185 +18,6 @@ require_once get_template_directory() . '/inc/classes/TextareaCustomControl.php'; } -if ( ! function_exists( 'coletivo_sanitize_checkbox' ) ) { - /** - * Sanitize checkbox - * - * @param int $input The checkbox value. - * @return bool - */ - function coletivo_sanitize_checkbox( $input ) { - if ( 1 === $input ) { - return 1; - } else { - return 0; - } - } -} - -/** - * Sanitize CSS code - * - * @param string $string The CSS code. - * - * @return string - */ -function coletivo_sanitize_css( $string ) { - $string = preg_replace( '@<(script|style)[^>]*?>.*?@si', '', $string ); - $string = wp_strip_all_tags( $string ); - return trim( $string ); -} - -/** - * Sanitize color alpha - * - * @param string $color The color value. - * - * @return string - */ -function coletivo_sanitize_color_alpha( $color ) { - $color = str_replace( '#', '', $color ); - if ( '' === $color ) { - return ''; - } - - // 3 or 6 hex digits, or the empty string. - if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', '#' . $color ) ) { - // convert to rgb. - $colour = $color; - if ( 6 === strlen( $colour ) ) { - list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] ); - } elseif ( 3 === strlen( $colour ) ) { - list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] ); - } else { - return false; - } - $r = hexdec( $r ); - $g = hexdec( $g ); - $b = hexdec( $b ); - return 'rgba( ' . join( - ',', - array( - 'r' => $r, - 'g' => $g, - 'b' => $b, - 'a' => 1, - ) - ) . ')'; - - } - - return false !== strpos( trim( $color ), 'rgb' ) ? $color : false; -} - -/** - * Sanitize repeatable data - * - * @param string $input The input string. - * @param object $setting $wp_customize. - * - * @return bool|mixed|string|void - */ -function coletivo_sanitize_repeatable_data_field( $input, $setting ) { - $control = $setting->manager->get_control( $setting->id ); - - $fields = $control->fields; - if ( is_string( $input ) ) { - $input = json_decode( wp_unslash( $input ), true ); - } - $data = wp_parse_args( $input, array() ); - - if ( ! is_array( $data ) ) { - return false; - } - if ( ! isset( $data['_items'] ) ) { - return false; - } - $data = $data['_items']; - - foreach ( $data as $i => $item_data ) { - foreach ( $item_data as $id => $value ) { - - if ( isset( $fields[ $id ] ) ) { - switch ( strtolower( $fields[ $id ]['type'] ) ) { - case 'text': - $data[ $i ][ $id ] = sanitize_text_field( $value ); - break; - case 'textarea': - case 'editor': - $data[ $i ][ $id ] = wp_kses_post( $value ); - break; - case 'color': - $data[ $i ][ $id ] = sanitize_hex_color_no_hash( $value ); - break; - case 'coloralpha': - $data[ $i ][ $id ] = coletivo_sanitize_color_alpha( $value ); - break; - case 'checkbox': - $data[ $i ][ $id ] = coletivo_sanitize_checkbox( $value ); - break; - case 'select': - $data[ $i ][ $id ] = ''; - if ( is_array( $fields[ $id ]['options'] ) && ! empty( $fields[ $id ]['options'] ) ) { - // if is multiple choices. - if ( is_array( $value ) ) { - foreach ( $value as $k => $v ) { - if ( isset( $fields[ $id ]['options'][ $v ] ) ) { - $value [ $k ] = $v; - } - } - $data[ $i ][ $id ] = $value; - } else { // is single choice. - if ( isset( $fields[ $id ]['options'][ $value ] ) ) { - $data[ $i ][ $id ] = $value; - } - } - } - - break; - case 'radio': - $data[ $i ][ $id ] = sanitize_text_field( $value ); - break; - case 'media': - $value = wp_parse_args( - $value, - array( - 'url' => '', - 'id' => false, - ) - ); - - $value['id'] = absint( $value['id'] ); - $data[ $i ][ $id ]['url'] = sanitize_text_field( $value['url'] ); - - if ( wp_get_attachment_url( $value['id'] ) === $url ) { - $data[ $i ][ $id ]['id'] = $value['id']; - $data[ $i ][ $id ]['url'] = $url; - } else { - $data[ $i ][ $id ]['id'] = ''; - } - - break; - default: - $data[ $i ][ $id ] = wp_kses_post( $value ); - } - } else { - $data[ $i ][ $id ] = wp_kses_post( $value ); - } - - if ( count( $data[ $i ] ) !== count( $fields ) ) { - foreach ( $fields as $k => $f ) { - if ( ! isset( $data[ $i ][ $k ] ) ) { - $data[ $i ][ $k ] = ''; - } - } - } - } - } - - return $data; -} - if ( ! class_exists( 'EditorCustomControl' ) ) { require_once get_template_directory() . '/inc/classes/EditorCustomControl.php'; } @@ -229,6 +50,6 @@ function customizer_control_scripts() { wp_enqueue_script( 'coletivo-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-controls', 'wp-color-picker' ), VERSION, true ); wp_enqueue_style( 'coletivo-customizer', get_template_directory_uri() . '/assets/css/customizer.css', false, VERSION ); - wp_add_inline_script( 'coletivo-customizer', 'coletivo_customizer', array( 'before_section_title' => __( 'Section: ', 'coletivo' ) ) ); + wp_localize_script( 'coletivo-customizer', 'coletivo_customizer', array( 'before_section_title' => __( 'Section: ', 'coletivo' ) ) ); } add_action( 'customize_controls_enqueue_scripts', 'customizer_control_scripts', 99 ); diff --git a/inc/customizer.php b/inc/customizer.php index df66718..b4d1d8f 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -93,38 +93,186 @@ function coletivo_customize_register( $wp_customize ) { require_once get_template_directory() . '/inc/customizer-selective-refresh.php'; /** - * Coletivo Sanitize Functions. + * Sanitize CSS code * - * @param string $file_url The URL file. + * @param string $string The CSS code. * * @return string */ -function coletivo_sanitize_file_url( $file_url ) { - $output = ''; - $filetype = wp_check_filetype( $file_url ); - if ( $filetype['ext'] ) { - $output = esc_url( $file_url ); +function coletivo_sanitize_css( $string ) { + $string = preg_replace( '@<(script|style)[^>]*?>.*?@si', '', $string ); + $string = wp_strip_all_tags( $string ); + return trim( $string ); +} + +/** + * Sanitize color alpha + * + * @param string $color The color value. + * + * @return string + */ +function coletivo_sanitize_color_alpha( $color ) { + $color = str_replace( '#', '', $color ); + if ( '' === $color ) { + return ''; } - return $output; + + // 3 or 6 hex digits, or the empty string. + if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', '#' . $color ) ) { + // convert to rgb. + $colour = $color; + if ( 6 === strlen( $colour ) ) { + list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] ); + } elseif ( 3 === strlen( $colour ) ) { + list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] ); + } else { + return false; + } + $r = hexdec( $r ); + $g = hexdec( $g ); + $b = hexdec( $b ); + return 'rgba( ' . join( + ',', + array( + 'r' => $r, + 'g' => $g, + 'b' => $b, + 'a' => 1, + ) + ) . ')'; + + } + + return false !== strpos( trim( $color ), 'rgb' ) ? $color : false; } /** - * Conditional to show more hero settings. + * Sanitize repeatable data * - * @param string $control The option of Hero Fullscreen. + * @param string $input The input string. + * @param object $setting $wp_customize. * - * @return bool + * @return bool|mixed|string|void */ -function coletivo_hero_fullscreen_callback( $control ) { - if ( $control->manager->get_setting( 'coletivo_hero_fullscreen' )->value() === '' ) { - return true; - } else { +function coletivo_sanitize_repeatable_data_field( $input, $setting ) { + $control = $setting->manager->get_control( $setting->id ); + + $fields = $control->fields; + if ( is_string( $input ) ) { + $input = json_decode( wp_unslash( $input ), true ); + } + $data = wp_parse_args( $input, array() ); + + if ( ! is_array( $data ) ) { return false; } + if ( ! isset( $data['_items'] ) ) { + return false; + } + $data = $data['_items']; + + foreach ( $data as $i => $item_data ) { + foreach ( $item_data as $id => $value ) { + + if ( isset( $fields[ $id ] ) ) { + switch ( strtolower( $fields[ $id ]['type'] ) ) { + case 'text': + $data[ $i ][ $id ] = sanitize_text_field( $value ); + break; + case 'textarea': + case 'editor': + $data[ $i ][ $id ] = wp_kses_post( $value ); + break; + case 'color': + $data[ $i ][ $id ] = sanitize_hex_color_no_hash( $value ); + break; + case 'coloralpha': + $data[ $i ][ $id ] = coletivo_sanitize_color_alpha( $value ); + break; + case 'checkbox': + $data[ $i ][ $id ] = coletivo_sanitize_checkbox( $value ); + break; + case 'select': + $data[ $i ][ $id ] = ''; + if ( is_array( $fields[ $id ]['options'] ) && ! empty( $fields[ $id ]['options'] ) ) { + // if is multiple choices. + if ( is_array( $value ) ) { + foreach ( $value as $k => $v ) { + if ( isset( $fields[ $id ]['options'][ $v ] ) ) { + $value [ $k ] = $v; + } + } + $data[ $i ][ $id ] = $value; + } else { // is single choice. + if ( isset( $fields[ $id ]['options'][ $value ] ) ) { + $data[ $i ][ $id ] = $value; + } + } + } + + break; + case 'radio': + $data[ $i ][ $id ] = sanitize_text_field( $value ); + break; + case 'media': + $value = wp_parse_args( + $value, + array( + 'url' => '', + 'id' => false, + ) + ); + + $value['id'] = absint( $value['id'] ); + $data[ $i ][ $id ]['url'] = sanitize_text_field( $value['url'] ); + + if ( wp_get_attachment_url( $value['id'] ) === $url ) { + $data[ $i ][ $id ]['id'] = $value['id']; + $data[ $i ][ $id ]['url'] = $url; + } else { + $data[ $i ][ $id ]['id'] = ''; + } + + break; + default: + $data[ $i ][ $id ] = wp_kses_post( $value ); + } + } else { + $data[ $i ][ $id ] = wp_kses_post( $value ); + } + + if ( count( $data[ $i ] ) !== count( $fields ) ) { + foreach ( $fields as $k => $f ) { + if ( ! isset( $data[ $i ][ $k ] ) ) { + $data[ $i ][ $k ] = ''; + } + } + } + } + } + + return $data; } /** - * Sanitize Number + * Sanitize file URL. + * + * @param string $file_url The URL file. + * + * @return string + */ +function coletivo_sanitize_file_url( $file_url ) { + $output = ''; + $filetype = wp_check_filetype( $file_url ); + if ( $filetype['ext'] ) { + $output = esc_url( $file_url ); + } + return $output; +} + +/** + * Sanitize number * * @param int $input The input number. * @@ -188,6 +336,21 @@ function coletivo_sanitize_html_input( $string ) { return wp_kses_allowed_html( $string ); } +/** + * Conditional to show more hero settings. + * + * @param string $control The option of Hero Fullscreen. + * + * @return bool + */ +function coletivo_hero_fullscreen_callback( $control ) { + if ( $control->manager->get_setting( 'coletivo_hero_fullscreen' )->value() === '' ) { + return true; + } else { + return false; + } +} + /** * Show on frontpage * diff --git a/inc/template-tags.php b/inc/template-tags.php index 9288c84..476f744 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -53,16 +53,10 @@ function coletivo_site_logo() { $classes['desc'] = 'no-desc'; } - printf( - '
            %s
            ', - 'site-brand-inner', - esc_attr( join( ' ', $classes ) ), - $html // phpcs:ignore - ); + echo '
            ' . wp_kses_post( $html ) . '
            '; } } -add_action( 'coletivo_site_start', 'coletivo_site_header' ); if ( ! function_exists( 'coletivo_site_header' ) ) { /** * Display site header @@ -99,6 +93,7 @@ function coletivo_site_header() { WordPress' ); ?> Date: Tue, 18 May 2021 23:12:32 -0300 Subject: [PATCH 29/32] =?UTF-8?q?Fix:=20Corre=C3=A7=C3=A3o=20do=20nome=20d?= =?UTF-8?q?a=20op=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/customizer-update-fields.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/customizer-update-fields.php b/inc/customizer-update-fields.php index be21d80..8bb8150 100644 --- a/inc/customizer-update-fields.php +++ b/inc/customizer-update-fields.php @@ -41,7 +41,7 @@ public function update_theme_mod() { if ( 'true' === get_option( 'tema_coletivo_updated_customizer', 'false' ) ) { return; } - $customizer_fields = get_option( 'theme_mods_tema-coletivo' ); + $customizer_fields = get_option( 'theme_mods_coletivo' ); if ( is_array( $customizer_fields ) ) { foreach ( $customizer_fields as $key => $value ) { @@ -52,7 +52,7 @@ public function update_theme_mod() { $customizer_fields[ $new_key ] = $value; unset( $customizer_fields[ $key ] ); } - update_option( 'theme_mods_tema-coletivo', $customizer_fields ); + update_option( 'theme_mods_coletivo', $customizer_fields ); update_option( 'tema_coletivo_updated_customizer', 'true' ); } } From c75569fb2139b04fac686034f2141dfe4ba413a9 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Wed, 19 May 2021 00:54:36 -0300 Subject: [PATCH 30/32] =?UTF-8?q?Fix:=20Esconder=20t=C3=ADtulo=20e=20descr?= =?UTF-8?q?i=C3=A7=C3=A3o=20do=20site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/customizer-components/customizer-site-identity.php | 6 +++--- inc/customizer.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/customizer-components/customizer-site-identity.php b/inc/customizer-components/customizer-site-identity.php index 9ff2038..dd52456 100644 --- a/inc/customizer-components/customizer-site-identity.php +++ b/inc/customizer-components/customizer-site-identity.php @@ -10,12 +10,12 @@ /** * Site Identity. */ -$is_old_logo = get_theme_mod( 'coletivo_site_image_logo' ); +$is_old_logo = get_theme_mod( 'custom_logo' ); $wp_customize->add_setting( 'coletivo_hide_sitetitle', array( 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => $is_old_logo ? 1 : 0, + 'default' => $is_old_logo ? true : false, ) ); @@ -32,7 +32,7 @@ 'coletivo_hide_tagline', array( 'sanitize_callback' => 'coletivo_sanitize_checkbox', - 'default' => $is_old_logo ? 1 : 0, + 'default' => $is_old_logo ? true : false, ) ); diff --git a/inc/customizer.php b/inc/customizer.php index b4d1d8f..062899a 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -307,10 +307,10 @@ function coletivo_sanitize_hex_color( $color ) { * @return bool */ function coletivo_sanitize_checkbox( $input ) { - if ( 1 === $input ) { - return 1; + if ( true === $input ) { + return true; } else { - return 0; + return false; } } From ffdfa125186ea6976b22b366f9be7b8df0db224e Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Wed, 19 May 2021 01:27:36 -0300 Subject: [PATCH 31/32] Fix: Esconder o "Voltar ao topo" --- footer.php | 2 +- inc/customizer-selective-refresh.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/footer.php b/footer.php index 55591f2..116a957 100644 --- a/footer.php +++ b/footer.php @@ -14,7 +14,7 @@
            - +
            diff --git a/inc/customizer-selective-refresh.php b/inc/customizer-selective-refresh.php index 07998fc..ba45677 100644 --- a/inc/customizer-selective-refresh.php +++ b/inc/customizer-selective-refresh.php @@ -281,6 +281,16 @@ function coletivo_customizer_partials( $wp_customize ) { ) ); + // Back to top. + $wp_customize->selective_refresh->add_partial( + 'coletivo_btt_disable', + array( + 'selector' => '', + 'settings' => array( 'coletivo_btt_disable' ), + 'render_callback' => 'coletivo_selective_refresh_btt_footer_button', + ) + ); + // Featured Page Content. $wp_customize->selective_refresh->add_partial( 'coletivo_featuredpage_content_source', @@ -329,6 +339,13 @@ function coletivo_selective_refresh_social_footer_title() { return get_theme_mod( 'coletivo_social_footer_title' ); } +/** + * Selective refresh back to top footer button + */ +function coletivo_selective_refresh_btt_footer_button() { + return get_theme_mod( 'coletivo_btt_disable' ); +} + /** * Selective refresh featured page * From 834a14f529d8c435da014250c01a375e598188a2 Mon Sep 17 00:00:00 2001 From: rodineicosta Date: Wed, 19 May 2021 01:34:21 -0300 Subject: [PATCH 32/32] =?UTF-8?q?Altera=C3=A7=C3=A3o=20m=C3=ADnima?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/template-tags.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 476f744..5ebeb03 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -118,12 +118,12 @@ function coletivo_posted_on() { ); $posted_on = sprintf( - __x( 'Posted on %s', 'post date', 'coletivo' ), + _x( 'Posted on %s', 'post date', 'coletivo' ), '' . $time_string . '' ); $byline = sprintf( - __x( 'by %s', 'post author', 'coletivo' ), + _x( 'by %s', 'post author', 'coletivo' ), '' . esc_html( get_the_author() ) . '' );