[wp-trac] [WordPress Trac] #42928: Formatting function wp_specialchars_decode doesn't work

WordPress Trac noreply at wordpress.org
Sun Dec 17 18:04:30 UTC 2017


#42928: Formatting function wp_specialchars_decode doesn't work
--------------------------+-----------------------------
 Reporter:  italooko      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:  4.9.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This in functions.php doesn't work, the string returns non-decoded quotes
 like &#8220, for example.
 {{{#!php
 <?php
 function get_title(){
    $title = wp_specialchars_decode(get_the_title(), ENT_QUOTES);
    $caracteres = strlen($title);
    $max = 73;
 if ($caracteres <= $max){
     return $title;
 }
 else {
     $title = substr($title, 0, $max);
     $title = $title.'...';
     return $title;      }
 }
 }}}

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


More information about the wp-trac mailing list