• Why is there a escape function for textareas but no sanitizing function?

    I’m trying to implement a textarea field for plugin settings like this:


    register_setting(
    'my-settings-group,
    'my-settings-customer-address',
    'sanitize_text_field'
    );

    sanitize_text_field() strips line-breaks which is not wanted in this context. I don’t need to encode HTML-chars or anything, I just want to prevent SQL injection.

    I haven’t been able to find a solution searching the forum, google and stackoverflow. Did I miss something obvious?

  • The topic ‘Sanitizing Textareas’ is closed to new replies.