|
|
|
@ -36,23 +36,69 @@ add_action('customize_register', function (\WP_Customize_Manager $wp_customize)
|
|
|
|
|
'section' => 'pb_network_social', |
|
|
|
|
'settings' => 'pb_network_twitter', |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_section('pb_network_catalog', [ |
|
|
|
|
'title' => __('Catalog', 'aldine'), |
|
|
|
|
$wp_customize->add_section('pb_front_page_content', [ |
|
|
|
|
'title' => __('Front Page Content', 'aldine'), |
|
|
|
|
'priority' => 20, |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_setting('pb_front_page_catalog'); |
|
|
|
|
for($i = 1; $i < 5; $i++) { |
|
|
|
|
$wp_customize->add_setting("pb_front_page_block_${i}_title", [ |
|
|
|
|
'type' => 'option', |
|
|
|
|
'sanitize_callback' => 'sanitize_text_field', |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_control("pb_front_page_block_${i}_title", [ |
|
|
|
|
'label' => sprintf(__('Block %d Title', 'aldine'), $i), |
|
|
|
|
'section' => 'pb_front_page_content', |
|
|
|
|
'settings' => "pb_front_page_block_${i}_title", |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_setting("pb_front_page_block_${i}_content", [ |
|
|
|
|
'type' => 'option', |
|
|
|
|
'sanitize_callback' => 'sanitize_textarea_field', |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_control("pb_front_page_block_${i}_content", [ |
|
|
|
|
'label' => sprintf(__('Block %d Content', 'aldine'), $i), |
|
|
|
|
'type' => 'textarea', |
|
|
|
|
'section' => 'pb_front_page_content', |
|
|
|
|
'settings' => "pb_front_page_block_${i}_content", |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_setting("pb_front_page_block_${i}_button_title", [ |
|
|
|
|
'type' => 'option', |
|
|
|
|
'sanitize_callback' => 'sanitize_text_field', |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_control("pb_front_page_block_${i}_button_title", [ |
|
|
|
|
'label' => sprintf(__('Block %d Button Title', 'aldine'), $i), |
|
|
|
|
'section' => 'pb_front_page_content', |
|
|
|
|
'settings' => "pb_front_page_block_${i}_button_title", |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_setting("pb_front_page_block_${i}_button_url", [ |
|
|
|
|
'type' => 'option', |
|
|
|
|
'sanitize_callback' => 'esc_url_raw', |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_control("pb_front_page_block_${i}_button_url", [ |
|
|
|
|
'label' => sprintf(__('Block %d Button URL', 'aldine'), $i), |
|
|
|
|
'section' => 'pb_front_page_content', |
|
|
|
|
'settings' => "pb_front_page_block_${i}_button_url", |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
$wp_customize->add_section('pb_front_page_catalog', [ |
|
|
|
|
'title' => __('Front Page Catalog', 'aldine'), |
|
|
|
|
'priority' => 25, |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_setting('pb_front_page_catalog', [ |
|
|
|
|
'type' => 'option', |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_control('pb_front_page_catalog', [ |
|
|
|
|
'label' => __('Show Front Page Catalog', 'aldine'), |
|
|
|
|
'section' => 'pb_network_catalog', |
|
|
|
|
'section' => 'pb_front_page_catalog', |
|
|
|
|
'settings' => 'pb_front_page_catalog', |
|
|
|
|
'type' => 'checkbox' |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_setting('pb_front_page_catalog_title', [ |
|
|
|
|
'type' => 'option', |
|
|
|
|
'sanitize_callback' => 'sanitize_text_field' |
|
|
|
|
]); |
|
|
|
|
$wp_customize->add_control('pb_front_page_catalog_title', [ |
|
|
|
|
'label' => __('Front Page Catalog Title', 'aldine'), |
|
|
|
|
'section' => 'pb_network_catalog', |
|
|
|
|
'section' => 'pb_front_page_catalog', |
|
|
|
|
'settings' => 'pb_front_page_catalog_title', |
|
|
|
|
]); |
|
|
|
|
}); |
|
|
|
|