WordPress.org

Support

Support » How-To and Troubleshooting » need to allow html and double quotes when saving meta data

need to allow html and double quotes when saving meta data

Viewing 1 replies (of 1 total)
  • instead of addslashes() try esc_html() or esc_textarea() – not sure which is the best but both should encode the special symbols.

    That’ll take care of the saving part so wp doesn’t strip out your code.

    But, I’m guessing you also want to print that data back as is without encoding. Try echoing that tag you saved and it should look weird.. (can’t put example here since it gets converted)

    So, you need to “convert” it back to original form. and html_entity_decode() does that for you http://php.net/manual/en/function.html-entity-decode.php

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘need to allow html and double quotes when saving meta data’ is closed to new replies.
Skip to toolbar