Hi,
You don’t need a type for this. Just remove the type line, and change from:
sanitize_callback' => 'zerif_sanitize_number'
to:
'sanitize_callback' => 'sanitize_text_field'
Regards,
Hardeep
$wp_customize->add_setting( 'zerif_aboutus_feature1_nr', array('sanitize_callback' => 'sanitize_text_field','default' => '50'));
$wp_customize->add_control(
new Zerif_Customizer_Number_Control(
$wp_customize,
'zerif_aboutus_feature1_nr',
array(
'label' => __( 'Feature no1 percentage', 'zerif' ),
'section' => 'zerif_aboutus_feature1_section',
'settings' => 'zerif_aboutus_feature1_nr',
'priority' => 3
)
)
);
Unfortunately that didn’t work. Whenever I enter anything else than a digit the ‘circle’ is not shown at all.
Hi,
Try this code:
$wp_customize->add_setting( 'zerif_aboutus_feature1_nr', array('sanitize_callback' => 'sanitize_text_field','default' => '50'));
$wp_customize->add_control(
$wp_customize,
'zerif_aboutus_feature1_nr',
array(
'label' => __( 'Feature no1 percentage', 'zerif' ),
'section' => 'zerif_aboutus_feature1_section',
'settings' => 'zerif_aboutus_feature1_nr',
'priority' => 3
)
);
Causes these notices:
Warning: Illegal offset type in isset or empty in /Applications/XAMPP/xamppfiles/htdocs/socialboosters/wp-includes/class-wp-customize-manager.php on line 722
Warning: Illegal offset type in /Applications/XAMPP/xamppfiles/htdocs/socialboosters/wp-includes/class-wp-customize-manager.php on line 840
Hi,
Let’s give it one last try:
$wp_customize->add_setting( 'zerif_aboutus_feature1_nr', array('sanitize_callback' => 'sanitize_text_field','capability' => 'edit_theme_options',));
$wp_customize->add_control(
'zerif_aboutus_feature1_nr',
array(
'label' => __( 'Feature no1 percentage', 'zerif' ),
'section' => 'zerif_aboutus_feature1_section',
'settings' => 'zerif_aboutus_feature1_nr',
'priority' => 3
));
Last code had $wp_customize which was causing this error. :p
Hi,
I’m glad it worked. Don’t forget to review the theme if you like it. 🙂
Regards,
Hardeep
What do the % even mean in about us to the viewer of the site — am I missing something?
What do the % even mean in about us to the viewer of the site — am I missing something?