[wp-trac] [WordPress Trac] #40993: WordPress is auto-generating a line break in my widgets

WordPress Trac noreply at wordpress.org
Tue Jun 20 19:56:49 UTC 2017


#40993: WordPress is auto-generating a line break in my widgets
--------------------------+-----------------------
 Reporter:  sandduner350  |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Widgets       |     Version:  4.8
 Severity:  major         |  Resolution:
 Keywords:  2nd-opinion   |     Focuses:
--------------------------+-----------------------

Old description:

> I upgraded to WordPress 4.8.I have a text widget that I was using html
> code with a div inside the div was my social media sprites. With the
> following code:
>
>         <div id="socialmedia">
>                 <a class="youtube"
> href="https://www.youtube.com/channel/UC2ZdXxa9tiTmuy1_eIQ47iA"
> target="_blank" rel="nofollow"> </a>
>                 <a class="twitter" href="https://twitter.com/KaoticMoto"
> target="_blank" rel="nofollow"> </a>
>                 <a class="google"
> href="https://plus.google.com/b/110788621461808163295" target="_blank"
> rel="nofollow"> </a>
>                 <a class="facebook"
> href="https://www.facebook.com/KaoticMoto/" target="_blank"
> rel="nofollow"> </a>
>                 <a class="instagram" href"https:="" www.instagram.com=""
> kaoticmoto="" "="" target="_blank" rel="nofollow"> </a>
>
>         </div>
>
> They are supposed to be showing up in a row but when you go to the
> website it shows a list.
>
> When I inspect the element with chrome and firefox it shows a <br>
>
> This is the code from the Chrome inspector (inserting the <br>)
> <div id="socialmedia">
>                 <a class="youtube"
> href="https://www.youtube.com/channel/UC2ZdXxa9tiTmuy1_eIQ47iA"
> target="_blank" rel="nofollow"> </a><br>
>                 <a class="twitter" href="https://twitter.com/KaoticMoto"
> target="_blank" rel="nofollow"> </a><br>
>                 <a class="google"
> href="https://plus.google.com/b/110788621461808163295" target="_blank"
> rel="nofollow"> </a><br>
>                 <a class="facebook"
> href="https://www.facebook.com/KaoticMoto/" target="_blank"
> rel="nofollow"> </a><br>
>                 <a class="instagram" href"https:="" www.instagram.com=""
> kaoticmoto="" "="" target="_blank" rel="nofollow"> </a><p></p></div>
>

> When I go back in to edit the code for that widget the only thing it
> shows is:
>
> <div id="socialmedia">
>

> </div>
>

>
> I can't find any information on how to fix this online.

New description:

 []I upgraded to WordPress 4.8.I have a text widget that I was using html
 code with a div inside the div was my social media sprites. With the
 following code:

         <div id="socialmedia">
                 <a class="youtube"
 href="https://www.youtube.com/channel/UC2ZdXxa9tiTmuy1_eIQ47iA"
 target="_blank" rel="nofollow"> </a>
                 <a class="twitter" href="https://twitter.com/KaoticMoto"
 target="_blank" rel="nofollow"> </a>
                 <a class="google"
 href="https://plus.google.com/b/110788621461808163295" target="_blank"
 rel="nofollow"> </a>
                 <a class="facebook"
 href="https://www.facebook.com/KaoticMoto/" target="_blank"
 rel="nofollow"> </a>
                 <a class="instagram" href"https:="" www.instagram.com=""
 kaoticmoto="" "="" target="_blank" rel="nofollow"> </a>

         </div>

 They are supposed to be showing up in a row but when you go to the website
 it shows a list.

 When I inspect the element with chrome and firefox it shows a <br>

 This is the code from the Chrome inspector (inserting the <br>)
 <div id="socialmedia">
                 <a class="youtube"
 href="https://www.youtube.com/channel/UC2ZdXxa9tiTmuy1_eIQ47iA"
 target="_blank" rel="nofollow"> </a><br>
                 <a class="twitter" href="https://twitter.com/KaoticMoto"
 target="_blank" rel="nofollow"> </a><br>
                 <a class="google"
 href="https://plus.google.com/b/110788621461808163295" target="_blank"
 rel="nofollow"> </a><br>
                 <a class="facebook"
 href="https://www.facebook.com/KaoticMoto/" target="_blank"
 rel="nofollow"> </a><br>
                 <a class="instagram" href"https:="" www.instagram.com=""
 kaoticmoto="" "="" target="_blank" rel="nofollow"> </a><p></p></div>


 When I go back in to edit the code for that widget the only thing it shows
 is:

 <div id="socialmedia">


 </div>



 I can't find any information on how to fix this online.

--

Comment (by westonruter):

 @bobbingwide shortcodes are not supported in Text widgets, so you must be
 adding support via a plugin? The filter priorities probably need to be
 modified so that shortcodes are processed earlier than `wpautop`.

 Rationale for shortcodes not being supported in core is explained in
 https://make.wordpress.org/core/2017/05/23/addition-of-tinymce-to-the-
 text-widget/

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40993#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list