Articles of esc textarea

Sanitizing textarea for wp_insert_post with TinyMCE enabled or disabled

I’m saving a post data from a front end form, where there is a <textarea>. I need to sanitize it properly so that won’t be harmful by any kind. The textarea can be a plain text area or, if TinyMCE activated, it can become a rich text editor, but may be not with all sort […]

sanitize vimeo embed code?

I have a custom meta box with a textarea where users can drop in vimeo embed code. Should I sanitize this code before I update_post_meta, and, if so, how should I go about it? I don’t want to strip out important information (like the iframe)…I just want to make sure nothing malicious is getting entered.

How to add text to comment form #content textarea?

I have a plugin that does validation on user submitted comments. When validation fails, I want to redirect them back to the comment form, and have their comment still appear in the comment box, so they don’t have to type it again. How can I add custom content to the comment form #content textarea?

Disable formatting on textarea

I’m using the following code in my plugin to display a <textarea> field on a page: echo ‘<textarea required=”required” name=”Message” class=”textarea” cols=”70″ rows=”10″>’.esc_textarea($message).'</textarea>’; However, WordPress seems to be inserting <p> and <br /> tags into the textarea contents if the message contains newline characters. I’m assuming this is being caused by the default wpautop() filter. […]

Convert textarea with wp_editor

I have a custom tabbed menu which has some input fields that works properly. I followed this tutorial: http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-8-validation-sanitisation-and-input-ii/ But, I need to replace the textarea input for the rich text element. I tried to use the function wp_editor() but I do not know how to pass the id from the textarea. How can I […]

How to stop wordpress from mangling HTML in a metabox textarea

Can anyone lend a hand and suggest the best way to get a textarea in a meta box to stop mangling HTML? I’ve been digging around here online… and here…and also here…looking for answers, but I don’t know how to piece them together properly to fit with what I’ve already done. Here’s what I have… […]

Alternative to esc_textarea

I need an alternative function to use with textareas in meta boxes instead of esc_textarea. The problem is that when I use this function with textarea’s it removes line breaks and paragraphs. Is there an alternative function that will keep the line breaks and paragraphs. I have tried the validation reference page in the Codex […]

How do I stop HTML entities in a custom meta box from being un-htmlentitied?

I have a custom meta box that is supposed to accept HTML, but the text I’m trying to input contains both double and single quotes (and ampersands), and it’s messing up the saved data – each time I reload the post, the data is duplicated with an extra single quote (and angle bracket) inserted at […]