You appear to be a bot. Output may be restricted
Description
Register customizer options.
Usage
TwentyTwenty_Customize::register( $wp_customize );
Parameters
- $wp_customize
- ( WP_Customize_Manager ) required – Theme Customizer object.
Returns
void
Source
File name: twentytwenty/classes/class-twentytwenty-customize.php
Lines:
101 to 200 of 396
$wp_customize->add_setting( 'accent_hue', array( 'default' => 344, 'type' => 'theme_mod', 'sanitize_callback' => 'absint', 'transport' => 'postMessage', ) ); // Add setting to hold colors derived from the accent hue. $wp_customize->add_setting( 'accent_accessible_colors', array( 'default' => array( 'content' => array( 'text' => '#000000', 'accent' => '#cd2653', 'secondary' => '#6d6d6d', 'borders' => '#dcd7ca', ), 'header-footer' => array( 'text' => '#000000', 'accent' => '#cd2653', 'secondary' => '#6d6d6d', 'borders' => '#dcd7ca', ), ), 'type' => 'theme_mod', 'transport' => 'postMessage', 'sanitize_callback' => array( __CLASS__, 'sanitize_accent_accessible_colors' ), ) ); // Add the hue-only colorpicker for the accent color. $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'accent_hue', array( 'section' => 'colors', 'settings' => 'accent_hue', 'description' => __( 'Apply a custom color for links, buttons, featured images.', 'twentytwenty' ), 'mode' => 'hue', 'active_callback' => function() use ( $wp_customize ) { return ( 'custom' === $wp_customize->get_setting( 'accent_hue_active' )->value() ); }, ) ) ); // Update background color with postMessage, so inline CSS output is updated as well. $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; /** * Theme Options */ $wp_customize->add_section( 'options', array( 'title' => __( 'Theme Options', 'twentytwenty' ), 'priority' => 40, 'capability' => 'edit_theme_options', ) ); /* Enable Header Search ----------------------------------------------- */ $wp_customize->add_setting( 'enable_header_search', array( 'capability' => 'edit_theme_options', 'default' => true, 'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ), )