OSDN Git Service

WordPressテンプレート使用ショップデモデータ追加。
[magic3/magic3.git] / templates / shop-isle / inc / customizer / features / feature-frontpage-video-section-controls.php
1 <?php
2 /**
3  * Customizer functionality for the Video Section.
4  *
5  * @package WordPress
6  * @subpackage Shop Isle
7  */
8
9 /**
10  * Hook controls for Video Section to Customizer.
11  */
12 function shop_isle_video_controls_customize_register( $wp_customize ) {
13
14         /* Video section */
15
16         $wp_customize->add_section(
17                 'shop_isle_video_section', array(
18                         'title'    => __( 'Video section', 'shop-isle' ),
19                         'priority' => apply_filters( 'shop_isle_section_priority', 25, 'shop_isle_video_section' ),
20                 )
21         );
22
23         /* Hide video */
24         $wp_customize->add_setting(
25                 'shop_isle_video_hide', array(
26                         'default'           => false,
27                         'transport'         => 'postMessage',
28                         'sanitize_callback' => 'shop_isle_sanitize_checkbox',
29                 )
30         );
31
32         $wp_customize->add_control(
33                 'shop_isle_video_hide', array(
34                         'type'        => 'checkbox',
35                         'label'       => __( 'Hide video section?', 'shop-isle' ),
36                         'section'     => 'shop_isle_video_section',
37                         'priority'    => 1,
38                 )
39         );
40
41         /* Title */
42         $wp_customize->add_setting(
43                 'shop_isle_video_title', array(
44                         'sanitize_callback' => 'shop_isle_sanitize_text',
45                         'transport'         => 'postMessage',
46                 )
47         );
48
49         $wp_customize->add_control(
50                 'shop_isle_video_title', array(
51                         'label'    => __( 'Title', 'shop-isle' ),
52                         'section'  => 'shop_isle_video_section',
53                         'priority' => 2,
54                 )
55         );
56
57         /* Youtube link */
58         $wp_customize->add_setting(
59                 'shop_isle_yt_link', array(
60                         'sanitize_callback' => 'esc_url',
61                 )
62         );
63
64         $wp_customize->add_control(
65                 'shop_isle_yt_link', array(
66                         'label'    => __( 'Youtube link', 'shop-isle' ),
67                         'section'  => 'shop_isle_video_section',
68                         'priority' => 3,
69                 )
70         );
71
72         /* Thumbnail */
73         $wp_customize->add_setting(
74                 'shop_isle_yt_thumbnail', array(
75                         'sanitize_callback' => 'esc_url',
76                 )
77         );
78
79         $wp_customize->add_control(
80                 new WP_Customize_Image_Control(
81                         $wp_customize, 'shop_isle_yt_thumbnail', array(
82                                 'label'       => __( 'Video thumbnail', 'shop-isle' ),
83                                 'section'     => 'shop_isle_video_section',
84                                 'priority'    => 4,
85                         )
86                 )
87         );
88
89         $wp_customize->get_section( 'shop_isle_video_section' )->panel = 'shop_isle_front_page_sections';
90
91 }
92
93 add_action( 'customize_register', 'shop_isle_video_controls_customize_register' );