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/ diff --git a/404.php b/404.php index dbb11c5..4c06789 100644 --- a/404.php +++ b/404.php @@ -4,10 +4,11 @@ * * @link https://codex.wordpress.org/Creating_an_Error_404_Page * - * @package coletivo + * @package Coletivo */ -get_header(); ?> +get_header(); +?>

404

@@ -24,22 +25,24 @@ - +

    'count', - 'order' => 'DESC', - 'show_count' => 1, - 'title_li' => '', - 'number' => 3, - ) ); + wp_list_categories( + array( + 'orderby' => 'count', + 'order' => 'DESC', + 'show_count' => 1, + 'title_li' => '', + 'number' => 3, + ) + ); ?>
- + @@ -51,5 +54,5 @@
- - \ No newline at end of file + + 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: diff --git a/archive.php b/archive.php index 515a6ba..b0e9f52 100644 --- a/archive.php +++ b/archive.php @@ -7,49 +7,55 @@ * @package coletivo */ -get_header(); ?> +get_header(); +?>
- - - +
- + + 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', 'list' ); - + } - + the_posts_navigation(); - + } else { - + get_template_part( 'template-parts/content', 'none' ); - + } + ?>
- \ No newline at end of file + diff --git a/comments.php b/comments.php index 6268565..6ffb5bc 100644 --- a/comments.php +++ b/comments.php @@ -7,7 +7,7 @@ * * @link https://codex.wordpress.org/Template_Hierarchy * - * @package coletivo + * @package Coletivo */ /* @@ -24,18 +24,18 @@ - +

' . get_the_title() . '' + printf( + esc_html( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'coletivo' ) ), // phpcs:ignore + wp_kses_post( number_format_i18n( get_comments_number() ) ), + '' . esc_html( get_the_title() ) . '' ); ?>

- 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> + 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through? ?> - +
    'coletivo_comment', - ) ); + ) + ); ?>
- 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> + 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through? ?> - + - + + // If comments are closed and there are comments, let's leave a little note, shall we? + if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) { + ?>

- + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..dbf14fc --- /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": { + "RedeLivre\\Coletivo\\": "inc/classes/" + } + } +} 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/footer.php b/footer.php index 77848ce..116a957 100644 --- a/footer.php +++ b/footer.php @@ -6,38 +6,39 @@ * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * - * @package coletivo + * @package Coletivo */ + ?> - - + + 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..3200554 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/inc/classes/AlphaColorControl.php b/inc/classes/AlphaColorControl.php new file mode 100644 index 0000000..7f7dcee --- /dev/null +++ b/inc/classes/AlphaColorControl.php @@ -0,0 +1,105 @@ +. + */ +class AlphaColorControl 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-metabox.php b/inc/classes/Odin_Metabox.php similarity index 71% rename from inc/class-metabox.php rename to inc/classes/Odin_Metabox.php index 53fd380..134e7b4 100644 --- a/inc/class-metabox.php +++ b/inc/classes/Odin_Metabox.php @@ -1,13 +1,27 @@ 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 +97,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 +149,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 +159,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 +195,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 +279,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 +296,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 +307,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 +317,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 +331,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 +359,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 +382,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 +401,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 +409,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 +423,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 +435,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 +454,7 @@ protected function field_image( $id, $current ) { $html .= '
    '; $html .= '
    '; - echo $html; + echo esc_html( $html ); } /** @@ -442,35 +463,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 +500,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 +514,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 +524,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/classes/TextareaCustomControl.php b/inc/classes/TextareaCustomControl.php new file mode 100644 index 0000000..cd0d357 --- /dev/null +++ b/inc/classes/TextareaCustomControl.php @@ -0,0 +1,35 @@ + + + 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..f50620e --- /dev/null +++ b/inc/customizer-components/customizer-section-contact.php @@ -0,0 +1,376 @@ +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 EditorCustomControl( + $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 MiscControl( + $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 MiscControl( + $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 EditorCustomControl( + $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..b872d82 --- /dev/null +++ b/inc/customizer-components/customizer-section-featured-page.php @@ -0,0 +1,182 @@ +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 AlphaColorControl( + $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..de0578c --- /dev/null +++ b/inc/customizer-components/customizer-section-features.php @@ -0,0 +1,218 @@ +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 EditorCustomControl( + $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 CustomizeRepeatableControl( + $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..618a712 --- /dev/null +++ b/inc/customizer-components/customizer-section-gallery.php @@ -0,0 +1,343 @@ +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 EditorCustomControl( + $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..4e674b8 --- /dev/null +++ b/inc/customizer-components/customizer-section-hero.php @@ -0,0 +1,491 @@ +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 CustomizeRepeatableControl( + $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 AlphaColorControl( + $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 EditorCustomControl( + $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 EditorCustomControl( + $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 EditorCustomControl( + $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', + ) +); + +use WP_Customize_Image_Control; + +$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..9fd1172 --- /dev/null +++ b/inc/customizer-components/customizer-section-news.php @@ -0,0 +1,199 @@ +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 EditorCustomControl( + $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 MiscControl( + $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..08167a4 --- /dev/null +++ b/inc/customizer-components/customizer-section-portfolio.php @@ -0,0 +1,190 @@ +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 EditorCustomControl( + $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..7ab98f2 --- /dev/null +++ b/inc/customizer-components/customizer-section-sections.php @@ -0,0 +1,66 @@ +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 CustomizeRepeatableControl( + $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..6184758 --- /dev/null +++ b/inc/customizer-components/customizer-section-services.php @@ -0,0 +1,215 @@ +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 EditorCustomControl( + $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 CustomizeRepeatableControl( + $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..a7ed64a --- /dev/null +++ b/inc/customizer-components/customizer-section-social.php @@ -0,0 +1,165 @@ +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 MiscControl( + $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 CustomizeRepeatableControl( + $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..7e688f7 --- /dev/null +++ b/inc/customizer-components/customizer-section-team.php @@ -0,0 +1,197 @@ +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 EditorCustomControl( + $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 CustomizeRepeatableControl( + $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..78da61e --- /dev/null +++ b/inc/customizer-components/customizer-section-video-lightbox.php @@ -0,0 +1,148 @@ +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 EditorCustomControl( + $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..dd52456 --- /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 ? true : false, + ) +); + +$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 ? true : false, + ) +); + +$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-controls.php b/inc/customizer-controls.php index d867161..dba1ce0 100644 --- a/inc/customizer-controls.php +++ b/inc/customizer-controls.php @@ -1,747 +1,55 @@ type ) { - default: - - case 'heading': - echo '' . $this->title . ''; - break; - - case 'custom_message' : - echo '

    ' . $this->description . '

    '; - break; - - case 'hr' : - echo '
    '; - break; - } - } +/* Autoload */ +if ( version_compare( PHP_VERSION, '5.6.0', '>=' ) ) { + require get_template_directory() . '/vendor/autoload.php'; } -class Coletivo_Textarea_Custom_Control extends WP_Customize_Control -{ - public function render_content() { - ?> - - ]*?>.*?@si', '', $string ); - $string = strip_tags($string); - return trim( $string ); +if ( ! class_exists( 'EditorCustomControl' ) ) { + require_once get_template_directory() . '/inc/classes/EditorCustomControl.php'; } - -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; +if ( ! class_exists( 'AlphaColorControl' ) ) { + require_once get_template_directory() . '/inc/classes/AlphaColorControl.php'; } - -/** - * Sanitize repeatable data - * - * @param $input - * @param $setting object $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; +if ( ! class_exists( 'CustomizeRepeatableControl' ) ) { + require_once get_template_directory() . '/inc/classes/CustomizeRepeatableControl.php'; } - -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 ?>

    -
    - . + * @return void */ -class coletivo_Alpha_Color_Control extends WP_Customize_Control { - - /** - * Official control name. - */ - public $type = 'alpha-color'; +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' ); - /** - * 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. ?> - - __( 'Section: ', 'coletivo' ) ) ); } - - - -/** - * Repeatable control class. - * - * @since 1.0.0 - * @access public - */ -class coletivo_Customize_Repeatable_Control extends WP_Customize_Control { - - /** - * The type of customize control being rendered. - * - * @since 1.0.0 - * @access public - * @var string - */ - public $type = 'repeatable'; - - // public $fields = array(); - - public $fields = array(); - public $live_title_id = null; - public $title_format = null; - public $defined_values = null; - public $id_key = null; - public $limited_msg = null; - public $args = array(); - - - public function __construct( $manager, $id, $args = array() ) - { - parent::__construct( $manager, $id, $args); - if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) { - $args['fields'] = array(); - } - foreach ( $args['fields'] as $key => $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', '' ); - - #> -
    - - -
    - - <# } #> - -
    - - <# } #> - <# } #> -
    -
    - - - | - - -
    -
    -
    -
    -
    - -
    - -
    -
  • - - - - - __( 'Section: ', 'coletivo' ) ) ); -} - -add_action( 'customize_controls_enqueue_scripts', 'onepres_customizer_control_scripts', 99 ); -add_action( 'customize_controls_enqueue_scripts', array( 'coletivo_Editor_Scripts', 'enqueue' ), 95 ); - +add_action( 'customize_controls_enqueue_scripts', 'customizer_control_scripts', 99 ); diff --git a/inc/customizer-selective-refresh.php b/inc/customizer-selective-refresh.php index 414c674..ba45677 100644 --- a/inc/customizer-selective-refresh.php +++ b/inc/customizer-selective-refresh.php @@ -1,305 +1,362 @@ -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', + ) + ); + + // 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', + 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 back to top footer button + */ +function coletivo_selective_refresh_btt_footer_button() { + return get_theme_mod( 'coletivo_btt_disable' ); +} + +/** + * 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(); diff --git a/inc/customizer.php b/inc/customizer.php index 1904d75..062899a 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -1,2866 +1,467 @@ 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'; + + // Remove default sections. + $wp_customize->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'; - /*------------------------------------------------------------------------*/ - /* End of Section Social - /*------------------------------------------------------------------------*/ + /** + * Hook to add other customize + */ + do_action( 'coletivo_customize_before_register', $wp_customize ); - /*------------------------------------------------------------------------*/ - /* Section: Sections - /*------------------------------------------------------------------------*/ - $wp_customize->add_section( 'coletivo_sections_options' , + $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( - 'priority' => 130, - 'title' => esc_html__( 'Sections', 'coletivo' ), - 'description' => '', + 'orderby' => 'display_name', + 'order' => 'ASC', + 'number' => '', ) ); - // Social Profiles - $wp_customize->add_setting( - 'coletivo_section_order', - array( - //'default' => '', - 'sanitize_callback' => 'coletivo_sanitize_repeatable_data_field', - 'transport' => 'refresh', // refresh or postMessage - ) ); + $option_users[0] = __( 'Select member', 'coletivo' ); + foreach ( $users as $user ) { + $option_users[ $user->ID ] = $user->display_name; + } - $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(), + /** + * 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'; - ) - ) - ); - // 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' - ) - ); + /** + * 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'; +require_once get_template_directory() . '/inc/customizer-selective-refresh.php'; + +/** + * 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 ] = ''; + } + } + } + } + } -/*------------------------------------------------------------------------*/ -/* coletivo Sanitize Functions. -/*------------------------------------------------------------------------*/ + return $data; +} +/** + * Sanitize file URL. + * + * @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 + * Sanitize number * - * @param $control - * @return bool + * @param int $input The input number. + * + * @return int */ -function coletivo_hero_fullscreen_callback ( $control ) { - if ( $control->manager->get_setting('coletivo_hero_fullscreen')->value() == '' ) { - return true; - } else { - return false; - } -} - - 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 ) { - return 1; - } else { - return 0; - } + if ( true === $input ) { + return true; + } else { + return false; + } } +/** + * 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 ); } +/** + * 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 + * + * @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 ) { - $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 ) { +function coletivo_get_customizer_priority( $panel ) { + $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/inc/dashboard.php b/inc/dashboard.php index c6daa84..22f41f6 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,176 @@ 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' ) ) ); // phpcs:ignore ?>

    +
    + -
    -

    Version ); ?>

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

    Name ); ?>

    -

    - -
    - - - - -
    - +
    +

    Version ) ); // phpcs:ignore ?>

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

    Name ) ); // phpcs:ignore ?>

    +

    + +
    + + + + +
    + '', 'id' => '')); - $url = ''; - if ($media['id'] != '') { - $url = wp_get_attachment_url($media['id']); - } - if ($url == '' && $media['url'] != '') { - $url = $media['url']; - } - return $url; - } + /** + * Get media from a variable + * + * @param array $media Media aaray. + * + * @return false|string + */ + function coletivo_get_media_url( $media = array() ) { + $media = wp_parse_args( + $media, + array( + 'url' => '', + 'id' => '', + ) + ); + $url = ''; + if ( '' !== $media['id'] ) { + $url = wp_get_attachment_url( $media['id'] ); + } + if ( '' === $url && '' !== $media['url'] ) { + $url = $media['url']; + } + return $url; + } } - -/** - * Get theme actions required - * - * @return array|mixed|void - */ -function coletivo_get_actions_required( ) { - - $actions = array(); - $front_page = get_option( 'page_on_front' ); - $actions['page_on_front'] = 'dismiss'; - $actions['page_template'] = 'dismiss'; - if ( $front_page <= 0 ) { - $actions['page_on_front'] = 'active'; - $actions['page_template'] = 'active'; - - } else { - if ( get_post_meta( $front_page, '_wp_page_template', true ) == 'template-frontpage.php' ) { - $actions['page_template'] = 'dismiss'; - } else { - $actions['page_template'] = 'active'; - } - } - - $actions = apply_filters( 'coletivo_get_actions_required', $actions ); - $actions_dismiss = get_option( 'coletivo_actions_dismiss' ); - - if ( $actions_dismiss && is_array( $actions_dismiss ) ) { - foreach ( $actions_dismiss as $k => $v ) { - if ( isset ( $actions[ $k ] ) ) { - $actions[ $k ] = 'dismiss'; - } - } - } - - return $actions; +if ( ! function_exists( 'coletivo_get_actions_required' ) ) { + /** + * Get theme actions required + * + * @return array|mixed|void + */ + function coletivo_get_actions_required() { + + $actions = array(); + $front_page = get_option( 'page_on_front' ); + $actions['page_on_front'] = 'dismiss'; + $actions['page_template'] = 'dismiss'; + if ( $front_page <= 0 ) { + $actions['page_on_front'] = 'active'; + $actions['page_template'] = 'active'; + + } else { + if ( get_post_meta( $front_page, '_wp_page_template', true ) === 'template-frontpage.php' ) { + $actions['page_template'] = 'dismiss'; + } else { + $actions['page_template'] = 'active'; + } + } + + $actions = apply_filters( 'coletivo_get_actions_required', $actions ); + $actions_dismiss = get_option( 'coletivo_actions_dismiss' ); + + if ( $actions_dismiss && is_array( $actions_dismiss ) ) { + foreach ( $actions_dismiss as $k => $v ) { + if ( isset( $actions[ $k ] ) ) { + $actions[ $k ] = 'dismiss'; + } + } + } + + return $actions; + } } -function coletivo_reset_actions_required () { - delete_option('coletivo_actions_dismiss'); +if ( ! function_exists( 'coletivo_reset_actions_required' ) ) { + /** + * Reset action + */ + function coletivo_reset_actions_required() { + delete_option( 'coletivo_actions_dismiss' ); + } + add_action( 'switch_theme', 'coletivo_reset_actions_required' ); } -/** - * - * Define initial values and configs on the activation theme. - * - * @author Everaldo Matias - * @since 23/04/1987 - * - */ -add_action( 'after_switch_theme', 'coletivo_initial_config' ); -function coletivo_initial_config() { - - $coletivo_initial_config = get_option( 'coletivo_initial_config', false ); - - if ( $coletivo_initial_config == false ) { - $page_title = 'Home Coletivo'; - $page_template = 'template-frontpage.php'; - $page_check = get_page_by_title( $page_title ); - $page = array( - 'post_type' => 'page', - 'post_title' => $page_title, - 'post_status' => 'publish', - 'post_author' => 1, - ); - - if ( ! isset( $page_check->ID ) ) { - $page_id = wp_insert_post( $page ); - update_post_meta( $page_id, '_wp_page_template', $page_template ); - update_option( 'page_on_front', $page_id ); - update_option( 'show_on_front', 'page' ); - update_option( 'coletivo_initial_config', true ); - } elseif( get_post_status( $page_check->ID ) != false ) { - update_post_meta( $page_check->ID, '_wp_page_template', $page_template ); - update_option( 'page_on_front', $page_check->ID ); - update_option( 'show_on_front', 'page' ); - update_option( 'coletivo_initial_config', true ); - } - } +if ( ! function_exists( 'coletivo_initial_config' ) ) { + /** + * + * Define initial values and configs on the activation theme. + * + * @author Everaldo Matias + * @since 23/04/1987 + */ + function coletivo_initial_config() { + + $coletivo_initial_config = get_option( 'coletivo_initial_config', false ); + + if ( false === $coletivo_initial_config ) { + $page_title = 'Home Coletivo'; + $page_template = 'template-frontpage.php'; + $page_check = get_page_by_title( $page_title ); + $page = array( + 'post_type' => 'page', + 'post_title' => $page_title, + 'post_status' => 'publish', + 'post_author' => 1, + ); + + if ( ! isset( $page_check->ID ) ) { + $page_id = wp_insert_post( $page ); + update_post_meta( $page_id, '_wp_page_template', $page_template ); + update_option( 'page_on_front', $page_id ); + update_option( 'show_on_front', 'page' ); + update_option( 'coletivo_initial_config', true ); + } elseif ( false !== get_post_status( $page_check->ID ) ) { + update_post_meta( $page_check->ID, '_wp_page_template', $page_template ); + update_option( 'page_on_front', $page_check->ID ); + update_option( 'show_on_front', 'page' ); + update_option( 'coletivo_initial_config', true ); + } + } + } + add_action( 'after_switch_theme', 'coletivo_initial_config' ); } -add_action('switch_theme', 'coletivo_reset_actions_required'); - -/** - * - * Remopve initial values and configs on the deactivation theme. - * - * @author Everaldo Matias - * @since 23/04/1987 - * @see coletivo_initial_config() function - * - */ -function coletivo_remove_config () { - - delete_option( 'page_on_front' ); - update_option( 'show_on_front', 'posts' ); - update_option( 'coletivo_initial_config', false ); +if ( ! function_exists( 'coletivo_remove_config' ) ) { + /** + * + * Remopve initial values and configs on the deactivation theme. + * + * @author Everaldo Matias + * @since 23/04/1987 + * @see coletivo_initial_config() function + */ + function coletivo_remove_config() { + + delete_option( 'page_on_front' ); + update_option( 'show_on_front', 'posts' ); + update_option( 'coletivo_initial_config', false ); + } + add_action( 'switch_theme', 'coletivo_remove_config' ); } -add_action( 'switch_theme', 'coletivo_remove_config' ); \ No newline at end of file diff --git a/inc/template-tags.php b/inc/template-tags.php index f50c5df..5ebeb03 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -9,146 +9,157 @@ /** * Display header brand + * * @since 1.2.1 */ if ( ! function_exists( 'coletivo_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 '
    '.$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 '
    ' . wp_kses_post( $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( + _x( 'Posted on %s', 'post date', 'coletivo' ), + '' . $time_string . '' + ); + + $byline = sprintf( + _x( 'by %s', 'post author', 'coletivo' ), + '' . esc_html( get_the_author() ) . '' + ); + + echo '' . $posted_on . ''; // phpcs:ignore + + 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 ); // phpcs:ignore + } + + /* 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 ); // phpcs:ignore + } + } + + 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,18 @@ function coletivo_entry_footer() * @return bool */ function coletivo_categorized_blog() { - if ( false === ( $all_the_cool_cats = get_transient( 'coletivo_categories' ) ) ) { + $all_the_cool_cats = get_transient( 'coletivo_categories' ); + if ( false === $all_the_cool_cats ) { // 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 +207,631 @@ 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 ) ? '' . esc_html__( 'Post author', 'coletivo' ) . '' : '' + ); + printf( + '', + esc_url( get_comment_link( $comment->comment_ID ) ), + esc_html( get_comment_time( 'c' ) ), + /* translators: 1: date, 2: time */ + esc_html( 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 string $color The hex color. + * @param int $alpha The alpha value. + * + * @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 - */ - 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, - .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: #; + /** + * 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, + .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: #; + -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: #; -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: #; - -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; - } - } - - #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-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 ); + } + + #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-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 ); } - + add_action( 'wp_enqueue_scripts', 'coletivo_custom_inline_style', 100 ); } - 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; + } else { + $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'] && 0 !== strpos( $array[ $k ]['icon'], 'fa' ) ) { + $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'] && 0 !== strpos( $array[ $k ]['icon'], 'fa' ) ) { + $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'; + 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; + + } } /** @@ -797,47 +839,49 @@ function coletivo_get_section_gallery_data() * * @since 1.2.6 * - * @param $data - * @param bool|true $inner + * @param string $data The gallery item data. + * @param bool $inner HTML Class. + * @param string $size The thumbnail size. + * * @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 ( 'full' === $size ) { + $thumb = $photo['full']; + } else { + $thumb = $photo['thumbnail']; + } + + $html .= ''; + if ( $inner ) { + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + } else { + $html .= ''; + } + + $html .= ''; + next( $data ); + } + reset( $data ); + + return $html; } @@ -845,135 +889,147 @@ function coletivo_gallery_html( $data, $inner = true, $size = 'thumbnail' ) { * Generate Gallery HTML * * @since 1.2.6 - * @param bool|true $echo + * @param bool $echo Variable to prints $div. + * * @return string */ -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; - } +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; // phpcs:ignore + } 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'); ?> - '; + } + + if ( '' !== $coletivo_footer_text ) { + echo '
    ' . esc_html( $coletivo_footer_text ) . '
    '; + } + + if ( '' !== $coletivo_footer_text_link ) { + echo ''; + } + + printf( esc_html__( '%2$s %1$s', 'coletivo' ), esc_attr( gmdate( 'Y' ) ), esc_attr( get_bloginfo() ) ); + ?> + + WordPress' ); ?> + - - + + - - - - +get_header(); + +if ( function_exists( 'coletivo_breadcrumb' ) ) { + echo wp_kses_post( coletivo_breadcrumb() ); +} +?>
    - \ No newline at end of file + diff --git a/page.php b/page.php index 25f0823..645b0d8 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/section-parts/section-contact.php b/section-parts/section-contact.php index 8949569..1eb0988 100644 --- a/section-parts/section-contact.php +++ b/section-parts/section-contact.php @@ -1,8 +1,14 @@ - - -
    - class=""> - - -
    - -
    - ' . esc_html($coletivo_contact_subtitle) . ''; ?> - ' . 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 '
    ' . wp_kses_post( apply_filters( 'the_content', $desc ) ) . '
    '; + } + ?> +
    + +
    + +
    + +
    + + +
    +

    + +

    +
    + +
    +
    + +
    + + +
    +
    + + + +
    + + +
    +
    + + + +
    + + +
    + +
    - - - -
    - - -
    -
    - - - -
    - - -
    -
    - - - -
    - - -
    -
    - - - -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    - - + + + +
    + + +
    +
    + + + +
    + + +
    +
    + + + +
    + + +
    +
    + + + +
    + + +
    +
    + +
    +
    +
    +
    + + +
    + - - - - - -
    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 ( ! $coletivo_features_disable && ! empty( $data ) ) { + $coletivo_features_desc = get_theme_mod( 'coletivo_features_desc' ); + + ?> + +
    class=""> + + +
    + +
    + ' . esc_html( $coletivo_features_subtitle ) . ''; + } - ?> -
    -
    - - - -
    -

    -
    -
    - ' . esc_html( $coletivo_features_title ) . ''; + } - ?> -
    -
    -
    - + if ( $coletivo_features_desc ) { + echo '
    ' . wp_kses_post( apply_filters( 'the_content', $coletivo_features_desc ) ) . '
    '; + } + ?> +
    + +
    +
    + $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 + + + - - -
    - 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 ) ).'
    ' ; }; ?> + ' . wp_kses_post( apply_filters( 'the_content', $hcl2_content ) ) . '
    '; + } + ?>
    - ' ; }; ?> + '; + } + ?>
    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..7cb6b8c 100644 --- a/section-parts/section-news.php +++ b/section-parts/section-news.php @@ -1,32 +1,50 @@ - - -
    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 '
    ' . wp_kses_post( apply_filters( 'the_content', $desc ) ) . '
    '; + } + ?> +
    @@ -35,33 +53,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 +93,12 @@
    - - - - - + + - - -
    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 '
    ' . wp_kses_post( apply_filters( 'the_content', $desc ) ) . '
    '; + } + ?> +
    '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 '
    ' . wp_kses_post( apply_filters( 'the_content', $desc ) ) . '
    '; + } + ?> +
    + +
    +
    '; - } - } 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=""> - - - + + +
    + - - -
    - class=""> - - -
    - -
    - ' . esc_html($coletivo_team_subtitle) . ''; ?> - ' . esc_html($coletivo_team_title) . ''; ?> - ' . apply_filters( 'the_content', wp_kses_post( $desc ) ) . '
    '; - } ?> -
    - -
    - +
    class=""> + +
    + +
    + ' . esc_html( $coletivo_team_subtitle ) . ''; + } - foreach ( $user_ids as $member ) { - $member = wp_parse_args( $member, array( - 'user_id' =>array(), - )); + if ( '' !== $coletivo_team_title ) { + echo '

    ' . esc_html( $coletivo_team_title ) . '

    '; + } - $link = isset( $member['link'] ) ? $member['link'] : ''; - $user_id = wp_parse_args( $member['user_id'],array( - 'id' => '', - ) ); + if ( $desc ) { + echo '
    ' . wp_kses_post( apply_filters( 'the_content', $desc ) ) . '
    '; + } + ?> +
    + +
    + -
    -
    - - - - - - - - -
    -
    -
    post_title ); ?>
    - post_content ); ?> -
    -
    - array(), + ) + ); - } // end foreach - } + $the_link = isset( $member['link'] ) ? $member['link'] : ''; + $user_id = wp_parse_args( + $member['user_id'], + array( + 'id' => '', + ) + ); - ?> -
    -
    - - -
    - - +
    +
    + + + + + + + + +
    +
    +
    + + + + post_title ); ?> + + + +
    + post_content ); ?> +
    +
    + +
    + + +
    + '; - echo '
    '; - } - ?> -
    - class=""> - - +if ( ( ! $coletivo_videolightbox_disable && ( $coletivo_videolightbox_video || $coletivo_videolightbox_heading ) ) || coletivo_is_selective_refresh() ) { - -
    - -
    - - - -
    - - -

    - -
    - + $coletivo_videolightbox_image = get_theme_mod( 'coletivo_videolightbox_image' ); + if ( ! coletivo_is_selective_refresh() ) { + if ( $coletivo_videolightbox_image ) { + echo '
    '; + echo '
    '; + } + ?> +
    class=""> + - + +
    + +
    + + + +
    + + +

    + +
    + -
    - '; - } - }?> - - +
    + '; + } + } } diff --git a/section-parts/section-yourslider.php b/section-parts/section-yourslider.php index fa79b49..a6405ca 100644 --- a/section-parts/section-yourslider.php +++ b/section-parts/section-yourslider.php @@ -1,35 +1,48 @@ - + +
    class=""> + +
    + +
    + ' . esc_html( $coletivo_yourslider_subtitle ) . ''; + } + + if ( '' !== $coletivo_yourslider_title ) { + echo '

    ' . esc_html( $coletivo_yourslider_title ) . '

    '; + } + ?> +
    + ' . wp_kses_post( apply_filters( 'the_content', $coletivo_yourslider_shortcode ) ) . '
    '; + } + } + wp_reset_postdata(); + ?> + + +
    + - - -
    - class=""> - -
    - -
    - ' . esc_html($coletivo_yourslider_subtitle) . ''; ?> - ' . esc_html($coletivo_yourslider_title) . ''; ?> -
    - ' . apply_filters( 'the_content', wp_kses_post( $coletivo_yourslider_shortcode ) ) . '
    '; - } ?> - - - - - -
    -