[wp-trac] [WordPress Trac] #40786: Leading spaces are added to custom textarea metabox

WordPress Trac noreply at wordpress.org
Wed May 17 14:22:57 UTC 2017


#40786: Leading spaces are added to custom textarea metabox
-------------------------------+-----------------------------
 Reporter:  subrataemfluence   |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  4.7.5
 Severity:  normal             |   Keywords:
  Focuses:  administration     |
-------------------------------+-----------------------------
 I am using `esc_atr(ltrim(rtrim(br2nl($meta_value))))` to place the value
 of post meta in textarea metabox I have created in my custom post type.

 {{{#!php
 <textarea id="<?php echo $id_name; ?>"
    name="<?php echo $id_name; ?>"
    rows="7" cols="80"
    style="width:100%" maxlength="<?php echo $maxlength; ?>"
    placeholder="<?php echo $placeholder_text; ?>"
    <?php if($is_required){ ?>required<?php } ?>>
    <?php echo esc_attr(ltrim( rtrim( br2nl($input_value)) ) ); ?>
 </textarea>
 }}}


 But whenever I go to edit the post, inside all textarea metaboxes values
 are pre-loaded with leading spaces (exactly 10 spaces) and additional line
 breaks!

 Also tried `esc_atr(trim(br2nl($meta_value)))` with no avail.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40786>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list