• Resolved Slobodan Manic

    (@slobodanmanic)


    Hi,

    I’m ditching theme settings page in favor of Customizer, a few things I can’t figure out:

    1. Do I still need to do the entire ‘register_setting’, ‘add_settings_section’ and ‘add_settings_field’ thing, or is Customizer enough?
    2. How would I validate ‘type’ = ‘text’ control in Customizer?

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Slobodan Manic

    (@slobodanmanic)

    Figured it out by browsing core code. In case someone else runs into this, when doing $wp_customize->add_setting you can set ‘sanitize_callback’ argument.

    Since it’s all working, I guess there’s absolutely no need to go through Settings API.

    Thread Starter Slobodan Manic

    (@slobodanmanic)

    Another option is to use filter hook:

    add_filter( 'customize_sanitize_{$customize_setting_id}', 'your_sanitize_function' );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Validating 'type' => 'text' Customizer control’ is closed to new replies.