I am trying to create a custom field (text/CSS code in textarea) that include the CSS suggestion like Additional CSS in the customizer: https://i.postimg.cc/9QhLPgVk/image.png. Does everybody has experience with that? I need any solution like the above screenshot here: https://i.postimg.cc/L55cpChD/image.png.
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 of buttons, may be with basic text formatting features like bold, italic, anchor, quote, bullet points etc. How can I sanitize the textarea data on …
I have created a wordpress theme, in the wordpress theme customizer I have added a couple of text areas where a user can input their own CSS or JS to be added to the head. The placement of the text area is fine, i.e. when a user adds code it is displayed on the right place in the page, however it is being formatted differently. For example, I add the following code to one of the textareas: jQuery(document).ready(function($){ $('full_page').css('min-height',($(window).height()-195)); }); …
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 the end. I'm guessing its trying to "close" what it thinks is an unclosed phrase in single quotes, when really its an apostrophe. I can …
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. Is there a way to disable filtering of <textarea> contents on a page? Edit Some more information about how my plugin works. It creates a …
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 add or manage de editor inside? I saw some tutorials but still with problems. Thanks in advance This is de Code: This is the code. …
It's a strange issue and I've seen it happen with plugins, however I don't know how to fix it. Maybe just a PHP issue? Anyhow, I have a settings/options page with several text areas. Upon saving, a "\" appears before each apostrophe. Each time it's saved, an additional back-slash appears. I'm not sure what code would be helpful to look at for this.
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?
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... add_action("admin_init", "tf_book_deets_create"); function tf_book_deets_create(){ add_meta_box('tf_book_details', 'Book Details', 'tf_book_details', 'books'); } function tf_book_details () { global $post; $custom = get_post_custom($post->ID); $tf_book_media = $custom["tf_book_media"][0]; $tf_book_review = $custom["tf_book_review"][0]; …
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 but had no luck finding a function.
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.