Register theme customizer settings when theme activates [duplicate]

You need only use the default value on the wp_customize and that is all

$wp_customize->add_setting('mytextoption', array(
    'default'        => 'defaultvalue',
    'capability'     => 'edit_theme_options',
    'type'           => 'option',

replace defaultvalue for the value you want, and when the user activate the theme this line will register the default value on the DB only when not exist on the DB

Leave a Comment