Welcome to WebmasterWorld Guest from 54.166.220.138

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Encode html code in [textfield] Meta Box Wordpress

     
4:23 pm on May 22, 2014 (gmt 0)



I've been building a custom plugin for creating a custom meta box

I have a problem now, whenever I put html code inside the textfield, it doesn't detect the code, I can't find any answer so far here, if you know how to deal with this please let me know

here is my code for displaying metabox in the post:
...<p>
<label for="meta-textarea" class="prfx-row-title"><?php _e( 'Short Bio', 'prfx-textdomain' )?></label>
<textarea name="meta-textarea" id="meta-textarea"><?php if ( isset ( $prfx_stored_meta['meta-textarea'] ) ) echo $prfx_stored_meta['meta-textarea'][0]; ?></textarea>
</p>
11:41 am on May 24, 2014 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



What are you trying to achieve? A WYSIWYG type editor?

html code inside the textfield, it doesn't detect the code


Yes, textarea's are for text/plain content. Any HTML inside the textarea will not be interpreted by the browser. But it is also invalid to include HTML inside the textarea - it must be converted to HTML entities (which you seem to suggest you are doing already by your title). But if an HTML element is converted to HTML entities then it's no longer an HTML element.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month