strip_tags sanitization in a group

Support General strip_tags sanitization in a group

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35492
    webdevwebdev
    Participant

    Hi,
    I have a group with four textarea fields inside. I wish to use strip_tags() on all four to ensure no <style> or <font> tags are included which will mess up the display.
    I've added 'strip_tags' into the Custom Sanitize Callback field for the Group, but when I try to save the fields, I get the following Warning:
    Warning: strip_tags() expects at most 2 parameters, 4 given

    Am I doing something wrong? Do I need to create a custom function to sanitize the content?
    Thanks in advance

    #35506
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The function strip_tags() allow passing 2 parameters but the sanitization callback passes 4 parameters so it will display the warning error. You need to create a custom callback to strip tags.

    Refer to this topic https://support.metabox.io/topic/custom-sanitization-in-group-subfields/#post-34323

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.