add_section( 'cc_audioalbum_section', array( 'priority' => '80', 'title' => __( 'Audio Album', 'audio-album' ), 'capability' => 'edit_theme_options', 'description' => __( '', 'audio-album' ), ) ); /** * Album Background * */ $wp_customize->add_setting( 'cc_audioalbum[bgcol]', array( 'default' => '#434a54', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bgcol', array( 'label' => __( 'Album background', 'audio-album' ), 'description' => __( 'The album background', 'audio-album' ), 'section' => 'cc_audioalbum_section', 'priority' => '20', 'settings' => 'cc_audioalbum[bgcol]', ) ) ); /** * Player * */ $wp_customize->add_setting( 'cc_audioalbum[playr]', array( 'default' => '#2e3137', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'playr', array( 'label' => __( 'Player Background', 'audio-album' ), 'description' => __( 'The background of the audio player', 'audio-album' ), 'section' => 'cc_audioalbum_section', 'priority' => '30', 'settings' => 'cc_audioalbum[playr]', ) ) ); /** * Text & Button colour * */ $wp_customize->add_setting( 'cc_audioalbum[txtbt]', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'txtbt', array( 'label' => __( 'Text & buttons', 'audio-album' ), 'description' => __( 'All text plus the play/pause & mute/unmute buttons', 'audio-album' ), 'section' => 'cc_audioalbum_section', 'priority' => '40', 'settings' => 'cc_audioalbum[txtbt]', ) ) ); /** * Time & Volume Bar * */ $wp_customize->add_setting( 'cc_audioalbum[tvcol]', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'tvcol', array( 'label' => __( 'Time & volume bars', 'audio-album' ), 'description' => __( 'The time and volume indicator bar, the play/pause & mute/unmute buttons on hover', 'audio-album' ), 'section' => 'cc_audioalbum_section', 'priority' => '50', 'settings' => 'cc_audioalbum[tvcol]', ) ) ); /** * Manual CSS * */ $wp_customize->add_setting( 'cc_audioalbum[manualcss]', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'cc_audioalbum_sanitize_checkbox', 'type' => 'option', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'manualcss', array( 'label' => __( 'Manual CSS', 'audio-album' ), 'description' => __( 'Remove the plugin\'s styles', 'audio-album' ), 'section' => 'cc_audioalbum_section', 'settings' => 'cc_audioalbum[manualcss]', 'type' => 'checkbox', 'priority' => '100', ) ); } add_action( 'customize_register', 'cc_audioalbum_customize_register' ); /** * Set up the customizer's color picker with custom options * */ function cc_audioalbum_customizer_colourpicker() { ?>