Your address will show here +12 34 56 78

Home Forums General topics for our real estate themes Allow html in custom fields in submission

This topic contains 0 replies, has 1 voice, and was last updated by  Anna 2 years, 3 months ago.

  • Author
  • #110922


    This is a security measure so that no one can inject malicious code into such fields and affect your site.

    If you wish to remove such security settings it is on your own risk.

    Here are our colleagues tips

    In the file theme-admin.php – right in the begining you have the code that saves the custom fields.  There are these lines

    $temp_array[1]= wp_kses( $_POST[‘add_field_label’][sanitize_key($key)] ,$allowed_html);

    $temp_array[2]= wp_kses( $_POST[‘add_field_type’][sanitize_key($key)] ,$allowed_html);

    $temp_array[3]= wp_kses ( $_POST[‘add_field_order’][sanitize_key($key)],$allowed_html);

    where the info is filtrated by wordpress’s wp_kses . To allow html code you need to edit the $allowed_html = array(); ( on line 6 ) and add there what html tags are allowed  . Please see this  for example and details.

You must be logged in to reply to this topic.