Customizer textarea field doesn’t keep break lines
-
Hi,
I’m creating a WordPress theme for a website with some customize fields inside the customizer panel, in order to make the render of different layout parts easy to custom.
Overall everything is working, however I got a little problem with textaera fields. If I write somes lines (separated with a break line, with the Enter key), the field doesn’t seem to save this state, and put all the text on the same line like a common text field. The problem occurs on save (so at the input, not at the render’s output).
Here’s the part of code relative to the textarea field in my customizer.php file :
$wp_customize->add_setting( 'ef_footer_resume', array( 'capability' => 'edit_theme_options', 'default' => '', //'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'ef_footer_resume', array( 'type' => 'textarea', 'label' => __( 'à propos'), 'section' => 'footer', ) );
I tried to remove (put in comment) the sanitize callback, but it doesn’t change anything. Can someone help me on this point ?
Thank you in advance.
Developing on WordPress 4.9.6
- The topic ‘Customizer textarea field doesn’t keep break lines’ is closed to new replies.