Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement #34 #42

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions inc/customizer-selective-refresh.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,20 @@ function coletivo_customizer_partials( $wp_customize ) {
'coletivo_featuredpage_overlay_color',
),
),

// section store
array(
'id' => 'store',
'selector' => '.section-store',
'settings' => array(
'coletivo_store_title',
'coletivo_store_subtitle',
'coletivo_store_desc',
'coletivo_store_number',
'coletivo_store_more_link',
'coletivo_store_more_text',
),
),

// section contact
array(
Expand Down
2 changes: 1 addition & 1 deletion inc/customizer-update-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct() {
}
/**
* Change "onepress" to "coletivo" in customizer fields
* @return type
* @return void
*/
public function update_theme_mod() {
if ( 'true' === get_option( 'tema_coletivo_updated_customizer', 'false' ) ) {
Expand Down
232 changes: 232 additions & 0 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2247,6 +2247,238 @@ function coletivo_customize_register( $wp_customize ) {
)
);
/*------------------------------------------------------------------------*/
/* Section: Store
/*------------------------------------------------------------------------*/
$wp_customize->add_panel( 'coletivo_store' ,
array(
'priority' => coletivo_get_customizer_priority( 'coletivo_store' ),
'title' => esc_html__( 'Section: Store', 'coletivo' ),
'description' => '',
'active_callback' => 'coletivo_showon_frontpage'
)
);
$wp_customize->add_section( 'coletivo_store_settings' ,
array(
'priority' => 3,
'title' => esc_html__( 'Section Settings', 'coletivo' ),
'description' => '',
'panel' => 'coletivo_store',
)
);
// Show Content
$wp_customize->add_setting( 'coletivo_store_disable',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);
$wp_customize->add_control( 'coletivo_store_disable',
array(
'type' => 'checkbox',
'label' => esc_html__('Hide this section?', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => esc_html__('Check this box to hide this section.', 'coletivo'),
)
);
// Section ID
$wp_customize->add_setting( 'coletivo_store_id',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => esc_html__('store', 'coletivo'),
)
);
$wp_customize->add_control( 'coletivo_store_id',
array(
'label' => esc_html__('Section ID:', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => esc_html__( 'The section id, we will use this for link anchor.', 'coletivo' )
)
);
// Title
$wp_customize->add_setting( 'coletivo_store_title',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__('Latest Products', 'coletivo'),
)
);
$wp_customize->add_control( 'coletivo_store_title',
array(
'label' => esc_html__('Section Title', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
)
);
// Sub Title
$wp_customize->add_setting( 'coletivo_store_subtitle',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__('Section subtitle', 'coletivo'),
)
);
$wp_customize->add_control( 'coletivo_store_subtitle',
array(
'label' => esc_html__('Section Subtitle', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
)
);
// Description
$wp_customize->add_setting( 'coletivo_store_desc',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => '',
)
);
$wp_customize->add_control( new coletivo_Editor_Custom_Control(
$wp_customize,
'coletivo_store_desc',
array(
'label' => esc_html__('Section Description', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
)
));
// hr
$wp_customize->add_setting( 'coletivo_store_settings_hr',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
)
);
$wp_customize->add_control( new coletivo_Misc_Control( $wp_customize, 'coletivo_store_settings_hr',
array(
'section' => 'coletivo_store_settings',
'type' => 'hr'
)
));
// Number of products to show.
$wp_customize->add_setting( 'coletivo_store_number',
array(
'sanitize_callback' => 'coletivo_sanitize_number',
'default' => '4',
)
);
$wp_customize->add_control( 'coletivo_store_number',
array(
'label' => esc_html__('Number of products to show', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
)
);
// Number of columns of products to show.
$wp_customize->add_setting( 'coletivo_store_columns',
array(
'sanitize_callback' => 'coletivo_sanitize_number',
'default' => '4',
)
);
$wp_customize->add_control( 'coletivo_store_columns',
array(
'label' => esc_html__('Number of columns of products to show', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
)
);
// Show Pagination
$wp_customize->add_setting( 'coletivo_store_paginate',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);
$wp_customize->add_control( 'coletivo_store_paginate',
array(
'label' => esc_html__('Toggles pagination on', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
'type' => 'checkbox',
)
);
// Products list order by
$wp_customize->add_setting( 'coletivo_store_orderby',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => 'title',
)
);
$wp_customize->add_control( 'coletivo_store_orderby',
array(
'label' => esc_html__('Products list order by', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
'type' => 'select',
'choices' => array(
'date' => esc_html__( 'The date the product was published', 'coletivo' ),
'id' => esc_html__( 'The post ID of the product', 'coletivo' ),
'menu_order' => esc_html__( 'The Menu Order', 'coletivo' ),
'popularity' => esc_html__( 'The number of purchases', 'coletivo' ),
'rand' => esc_html__( 'Randomly order the products', 'coletivo' ),
'rating' => esc_html__( 'The average product rating', 'coletivo' ),
'title' => esc_html__( 'The product title', 'coletivo' ),
),
)
);
// Products list order
$wp_customize->add_setting( 'coletivo_store_order',
array(
'sanitize_callback' => 'coletivo_sanitize_text',
'default' => 'ASC',
)
);
$wp_customize->add_control( 'coletivo_store_order',
array(
'label' => esc_html__('Products list order', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
'type' => 'select',
'choices' => array(
'ASC' => esc_html__( 'Ascending', 'coletivo' ),
'DESC' => esc_html__( 'Descending', 'coletivo' ),
),
)
);
// Show Pagination
$wp_customize->add_setting( 'coletivo_store_on_sale',
array(
'sanitize_callback' => 'coletivo_sanitize_checkbox',
'default' => '',
)
);
$wp_customize->add_control( 'coletivo_store_on_sale',
array(
'label' => esc_html__('Shows only on-sales products', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
'type' => 'checkbox',
)
);
// Store Button
$wp_customize->add_setting( 'coletivo_store_more_link',
array(
'sanitize_callback' => 'esc_url',
'default' => '#',
)
);
$wp_customize->add_control( 'coletivo_store_more_link',
array(
'label' => esc_html__('More Products button link', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => esc_html__( 'It should be your store page link.', 'coletivo' )
)
);
$wp_customize->add_setting( 'coletivo_store_more_text',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => esc_html__('Browse our store', 'coletivo'),
)
);
$wp_customize->add_control( 'coletivo_store_more_text',
array(
'label' => esc_html__('More Products Button Text', 'coletivo'),
'section' => 'coletivo_store_settings',
'description' => '',
)
);
/*------------------------------------------------------------------------*/
/* Section: Contact
/*------------------------------------------------------------------------*/
$wp_customize->add_panel( 'coletivo_contact' ,
Expand Down
Binary file modified languages/pt_BR.mo
Binary file not shown.
Loading