Opened 7 years ago
Closed 7 years ago
#42928 closed defect (bug) (invalid)
Formatting function wp_specialchars_decode doesn't work
Reported by: | italooko | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9.1 |
Component: | Formatting | Keywords: | |
Focuses: | Cc: |
Description
This in functions.php doesn't work, the string returns non-decoded quotes like “, for example.
<?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; } }
Change History (1)
Note: See
TracTickets for help on using
tickets.
Hi @italooko and welcome to Trac.
wp_specialchars_decode()
working as described is correct.As the documentation reads:
If you want the behaviour of the PHP function
html_entity_decode()
call it directly.