The settings
attribute you’re using for add_control()
is expecting an array of all settings tied to the control while you’re passing a string. The attribute you want is the singular setting
which is expecting the string value of the primary setting for the control.
So try this:
$wp_customize->add_control( 'button_1_text', array(
'label' => __( 'Primary Button', 'test_theme' ),
'section' => 'header_buttons',
'setting' => 'button_1_text_settings',
'type' => 'text'
));
It’s also not clear to me if it’s best practice, but I tend to use the same string as my setting ID for my control ID, then I can just omit the setting
attribute since it defaults to the ID, like this:
$wp_customize->add_setting( 'button_1_text', array(
'type' => 'theme_mod',
'default' => __('Primary Button Text', 'test_theme'),
'transport' => 'postMessage'
));
$wp_customize->add_control( 'button_1_text', array(
'label' => __( 'Primary Button', 'test_theme' ),
'section' => 'header_buttons',
'type' => 'text'
));