/home/vianto5/ceibaresidencial.mx/wp-content/themes/moore_old/inc
Edit: /home/vianto5/ceibaresidencial.mx/wp-content/themes/moore_old/inc/class-customize.php (26957B)
moore_init_remove_setting( $wp_customize );
$this->moore_init_ova_typography( $wp_customize );
$this->moore_init_ova_color( $wp_customize );
$this->moore_init_ova_layout( $wp_customize );
$this->moore_init_ova_header( $wp_customize );
$this->moore_init_ova_footer( $wp_customize );
$this->moore_init_ova_blog( $wp_customize );
if( moore_is_woo_active() ){
$this->moore_init_ova_woo( $wp_customize );
}
do_action( 'moore_customize_register', $wp_customize );
}
public function moore_init_remove_setting( $wp_customize ){
/* Remove Colors & Header Image Customize */
$wp_customize->remove_section('colors');
$wp_customize->remove_section('header_image');
$wp_customize->add_setting( 'logo', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'logo', array(
'label' => esc_html__( 'Logo Default', 'moore' ),
'section' => 'title_tagline',
'settings' => 'logo'
)));
}
/* Typo */
public function moore_init_ova_typography($wp_customize){
/* Body Pane ******************************/
$wp_customize->add_section( 'typo_general' , array(
'title' => esc_html__( 'Typography', 'moore' ),
'priority' => 1,
// 'panel' => 'typo_panel',
) );
/* General Typo */
$wp_customize->add_setting( 'general_heading', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
/* Message */
$wp_customize->add_setting( 'text_typo_message', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control(
new Moore_Customize_Control_Heading(
$wp_customize,
'text_typo_message',
array(
'label' => esc_html__('Text Font','moore'),
'section' => 'typo_general',
'settings' => 'text_typo_message',
) )
);
/* Font Size */
$wp_customize->add_setting( 'general_font_size', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '14px',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('general_font_size', array(
'label' => esc_html__('Font Size','moore'),
'description' => esc_html__('Example: 16px, 1.2em','moore'),
'section' => 'typo_general',
'settings' => 'general_font_size',
'type' =>'text'
));
/* Line Height */
$wp_customize->add_setting( 'general_line_height', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '1.86em',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('general_line_height', array(
'label' => esc_html__('Line height','moore'),
'description' => esc_html__('Example: 23px, 1.5em','moore'),
'section' => 'typo_general',
'settings' => 'general_line_height',
'type' =>'text'
));
/* Letter Space */
$wp_customize->add_setting( 'general_letter_space', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '0px',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('general_letter_space', array(
'label' => esc_html__('Letter Spacing','moore'),
'description' => esc_html__('Example: 0px, 0.5em','moore'),
'section' => 'typo_general',
'settings' => 'general_letter_space',
'type' =>'text'
));
$wp_customize->add_control(
new Moore_Customize_Control_Heading(
$wp_customize,
'general_heading',
array(
'label' => esc_html__('Primary Font','moore'),
'section' => 'typo_general',
'settings' => 'general_heading',
) )
);
/* General Font */
$wp_customize->add_setting( 'primary_font',
array(
'default' => moore_default_primary_font(),
'sanitize_callback' => 'moore_google_font_sanitization'
)
);
$wp_customize->add_control( new Moore_Google_Font_Select_Custom_Control( $wp_customize, 'primary_font',
array(
'label' => esc_html__( 'Primary Font', 'moore' ),
'section' => 'typo_general',
'input_attrs' => array(
'font_count' => 'all',
'orderby' => 'popular',
),
)
) );
/* Message */
$wp_customize->add_setting( 'second_font_message', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control(
new Moore_Customize_Control_Heading(
$wp_customize,
'second_font_message',
array(
'label' => esc_html__('Second Font','moore'),
'section' => 'typo_general',
'settings' => 'second_font_message',
) )
);
/* Heading Font */
$wp_customize->add_setting( 'second_font',
array(
'default' => moore_default_second_font(),
'sanitize_callback' => 'moore_google_font_sanitization'
)
);
$wp_customize->add_control( new Moore_Google_Font_Select_Custom_Control( $wp_customize, 'second_font',
array(
'label' => esc_html__( 'Font', 'moore' ),
'section' => 'typo_general',
'input_attrs' => array(
'font_count' => 'all',
'orderby' => 'popular',
),
)
) );
/* Custom Font */
/* Message */
$wp_customize->add_setting( 'custom_font_message', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control(
new Moore_Customize_Control_Heading(
$wp_customize,
'custom_font_message',
array(
'label' => esc_html__('Custom Font','moore'),
'section' => 'typo_general',
'settings' => 'custom_font_message',
) )
);
$wp_customize->add_control(
new Moore_Customize_Control_Heading(
$wp_customize,
'custom_font_message',
array(
'label' => esc_html__('Custom Font','moore'),
'section' => 'typo_general',
'settings' => 'custom_font_message',
) )
);
$wp_customize->add_setting( 'ova_custom_font', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('ova_custom_font', array(
'label' => esc_html__('Custom Font','moore'),
'description' => esc_html__('Step 1: Insert font-face in style.css file: Refer https://www.w3schools.com/cssref/css3_pr_font-face_rule.asp. Step 2: Insert font-family and font-weight like format:
["Perpetua", "Regular:Bold:Italic:Light"] | ["Name-Font", "Regular:Bold:Italic:Light"]. Step 3: Refresh customize page to display new font in dropdown font field.','moore'),
'section' => 'typo_general',
'settings' => 'ova_custom_font',
'type' =>'textarea'
));
}
/* Color */
public function moore_init_ova_color( $wp_customize ){
/* Body Pane ******************************/
$wp_customize->add_section( 'color_section' , array(
'title' => esc_html__( 'Color', 'moore' ),
'priority' => 2,
// 'panel' => 'typo_panel',
) );
$wp_customize->add_setting( 'primary_color', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'transport' => 'refresh', // or postMessage
'default' => '#2f2f2f',
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'primary_color',
array(
'label' => esc_html__("Primary",'moore'),
'section' => 'color_section',
'settings' => 'primary_color',
) )
);
$wp_customize->add_setting( 'text_color', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '#444444',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'text_color',
array(
'label' => esc_html__("Text",'moore'),
'section' => 'color_section',
'settings' => 'text_color',
) )
);
$wp_customize->add_setting( 'heading_color', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '#2F2F2F',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'heading_color',
array(
'label' => esc_html__("Heading",'moore'),
'section' => 'color_section',
'settings' => 'heading_color',
) )
);
}
/* Layout */
public function moore_init_ova_layout( $wp_customize ){
$wp_customize->add_section( 'layout_section' , array(
'title' => esc_html__( 'Layout', 'moore' ),
'priority' => 2,
) );
$wp_customize->add_setting( 'global_preload', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'yes',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('global_preload', array(
'label' => esc_html__('Preload','moore'),
'section' => 'layout_section',
'settings' => 'global_preload',
'type' =>'select',
'choices' => array(
'yes' => esc_html__('Yes', 'moore'),
'no' => esc_html__('No', 'moore')
)
));
$wp_customize->add_setting( 'global_boxed_container_width', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '1170',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('global_boxed_container_width', array(
'label' => esc_html__('Container (px)','moore'),
'section' => 'layout_section',
'settings' => 'global_boxed_container_width',
'type' =>'number',
'default' => '1170'
));
$wp_customize->add_setting( 'global_layout', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'layout_2r',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('global_layout', array(
'label' => esc_html__('Layout','moore'),
'section' => 'layout_section',
'settings' => 'global_layout',
'type' =>'select',
'choices' => apply_filters( 'moore_define_layout', '' )
));
$wp_customize->add_setting( 'global_sidebar_width', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '320',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('global_sidebar_width', array(
'label' => esc_html__('Sidebar Width (px)','moore'),
'section' => 'layout_section',
'settings' => 'global_sidebar_width',
'type' =>'number'
));
$wp_customize->add_setting( 'global_wide_site', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'wide',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('global_wide_site', array(
'label' => esc_html__('Wide Site','moore'),
'section' => 'layout_section',
'settings' => 'global_wide_site',
'type' =>'select',
'choices' => apply_filters('moore_define_wide_boxed', '')
));
$wp_customize->add_setting( 'global_boxed_offset', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '20',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('global_boxed_offset', array(
'label' => esc_html__('Boxed Offset (px)','moore'),
'section' => 'layout_section',
'settings' => 'global_boxed_offset',
'type' =>'number',
'default' => '20'
));
}
/* Header */
public function moore_init_ova_header( $wp_customize ){
$wp_customize->add_section( 'header_section' , array(
'title' => esc_html__( 'Header', 'moore' ),
'priority' => 3,
) );
$wp_customize->add_setting( 'global_header', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'default',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('global_header', array(
'label' => esc_html__('Header Default','moore'),
'description' => esc_html__('This isn\'t effect in Blog' ,'moore'),
'section' => 'header_section',
'settings' => 'global_header',
'type' =>'select',
'choices' => apply_filters('moore_list_header', '')
));
}
/* Footer */
public function moore_init_ova_footer( $wp_customize ){
$wp_customize->add_section( 'footer_section' , array(
'title' => esc_html__( 'Footer', 'moore' ),
'priority' => 4,
) );
$wp_customize->add_setting( 'global_footer', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'default',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('global_footer', array(
'label' => esc_html__('Footer Default','moore'),
'description' => esc_html__('This isn\'t effect in Blog' ,'moore'),
'section' => 'footer_section',
'settings' => 'global_footer',
'type' =>'select',
'choices' => apply_filters('moore_list_footer', '')
));
}
/* Blog */
public function moore_init_ova_blog( $wp_customize ){
$wp_customize->add_panel( 'blog_panel', array(
'title' => esc_html__( 'Blog', 'moore' ),
'priority' => 5,
) );
$wp_customize->add_section( 'blog_section' , array(
'title' => esc_html__( 'Archive', 'moore' ),
'priority' => 30,
'panel' => 'blog_panel',
) );
$wp_customize->add_setting( 'blog_template', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'default',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('blog_template', array(
'label' => esc_html__('Type','moore'),
'section' => 'blog_section',
'settings' => 'blog_template',
'type' =>'select',
'choices' => array(
'default' => esc_html__('Default', 'moore'),
'grid' => esc_html__('Grid', 'moore'),
'masonry' => esc_html__('Masonry', 'moore'),
)
));
$wp_customize->add_setting( 'blog_layout', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'layout_2r',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('blog_layout', array(
'label' => esc_html__('Layout','moore'),
'section' => 'blog_section',
'settings' => 'blog_layout',
'type' =>'select',
'choices' => apply_filters( 'moore_define_layout', '' )
));
$wp_customize->add_setting( 'blog_header', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'default',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('blog_header', array(
'label' => esc_html__('Header','moore'),
'section' => 'blog_section',
'settings' => 'blog_header',
'type' =>'select',
'choices' => apply_filters('moore_list_header', '')
));
$wp_customize->add_setting( 'blog_footer', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'default',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('blog_footer', array(
'label' => esc_html__('Footer','moore'),
'section' => 'blog_section',
'settings' => 'blog_footer',
'type' =>'select',
'choices' => apply_filters('moore_list_footer', '')
));
$wp_customize->add_section( 'single_section' , array(
'title' => esc_html__( 'Single', 'moore' ),
'priority' => 30,
'panel' => 'blog_panel',
) );
$wp_customize->add_setting( 'single_layout', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'layout_2r',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('single_layout', array(
'label' => esc_html__('Layout','moore'),
'section' => 'single_section',
'settings' => 'single_layout',
'type' =>'select',
'choices' => apply_filters( 'moore_define_layout', '' )
));
$wp_customize->add_setting( 'single_header', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'default',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('single_header', array(
'label' => esc_html__('Header','moore'),
'section' => 'single_section',
'settings' => 'single_header',
'type' =>'select',
'choices' => apply_filters('moore_list_header', '')
));
$wp_customize->add_setting( 'single_footer', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'default',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('single_footer', array(
'label' => esc_html__('Footer','moore'),
'section' => 'single_section',
'settings' => 'single_footer',
'type' =>'select',
'choices' => apply_filters('moore_list_footer', '')
));
}
public function moore_init_ova_woo( $wp_customize ){
$wp_customize->add_setting( 'woo_archive_layout', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'woo_layout_1c',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('woo_archive_layout', array(
'label' => esc_html__('Archive Layout','moore'),
'section' => 'woocommerce_product_catalog',
'settings' => 'woo_archive_layout',
'type' =>'select',
'choices' => array(
'woo_layout_1c' => esc_html__('No Sidebar', 'moore'),
'woo_layout_2r' => esc_html__('Right Sidebar', 'moore'),
'woo_layout_2l' => esc_html__('Left Sidebar', 'moore'),
)
));
$wp_customize->add_setting( 'woo_sidebar_width', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => '320',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('woo_sidebar_width', array(
'label' => esc_html__('Sidebar Width (px)','moore'),
'section' => 'woocommerce_product_catalog',
'settings' => 'woo_sidebar_width',
'type' =>'number'
));
/* Show/hide title in category,tag */
$wp_customize->add_setting( 'woo_archive_show_title', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field', // Get function name
'default' => 'yes',
) );
$wp_customize->add_control('woo_archive_show_title', array(
'label' => esc_html__('Show/Hide Title','moore'),
'section' => 'woocommerce_product_catalog',
'settings' => 'woo_archive_show_title',
'type' => 'select',
'choices' => array(
'yes' => esc_html__('Yes', 'moore'),
'no' => esc_html__('No', 'moore'),
)
));
$wp_customize->add_section( 'product_detail' , array(
'title' => esc_html__( 'Product detail', 'moore' ),
'priority' => 30,
'panel' => 'woocommerce',
) );
$wp_customize->add_setting( 'woo_product_layout', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'woo_layout_1c',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field' // Get function name
) );
$wp_customize->add_control('woo_product_layout', array(
'label' => esc_html__('Single Layout','moore'),
'section' => 'product_detail',
'settings' => 'woo_product_layout',
'type' =>'select',
'choices' => array(
'woo_layout_1c' => esc_html__('No Sidebar', 'moore'),
'woo_layout_2r' => esc_html__('Right Sidebar', 'moore'),
'woo_layout_2l' => esc_html__('Left Sidebar', 'moore'),
)
));
$wp_customize->add_setting( 'woo_product_detail_show_title', array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'transport' => 'refresh', // or postMessage
'sanitize_callback' => 'sanitize_text_field', // Get function name
'default' => 'yes',
) );
$wp_customize->add_control('woo_product_detail_show_title', array(
'label' => esc_html__('Show/Hide Title','moore'),
'section' => 'product_detail',
'settings' => 'woo_product_detail_show_title',
'type' => 'select',
'choices' => array(
'yes' => esc_html__('Yes', 'moore'),
'no' => esc_html__('No', 'moore'),
)
));
}
}
}
new Moore_Customize();