Title twice encoded for get_the_title
-
Value for og:title is twice encoded if fetched by get_the_title, my straight fix for titles only.
[ 1 ] C:\Installation\Content Management\WordPress\Plugins\complete-open-graph.2.1.4\src\OpenGraph.php 16.08.2017, 01:37:52 [ 2 ] C:\wp-content\plugins\complete-open-graph\src\OpenGraph.php 16.08.2017, 01:57:42 ------------------------------------------------------------------------------------------------------------------------ +++ \Installation\Content Management\WordPress\Plugins\complete-open-graph.2.1.4\src\OpenGraph.php 16.8.2017 1:37:52 --- \wp-content\plugins\complete-open-graph\src\OpenGraph.php 16.8.2017 1:57:42 ----------- @@ +62,7 -62,7 @@ $startTime = microtime(true); foreach($this->get_open_graph_values() as $key=>$data) { + $content = preg_replace( "/\r|\n/", "", htmlentities($data['value'])); - $content = preg_replace( "/\r|\n/", "", $data['value']); if($data['value']) { if($data['attribute'] === 'property') { @@ +156,9 -156,9 @@ 'attribute' => 'property', 'value' => $this->get_open_graph_value( 'title', array( + Utilities::get_post_option('title'), - htmlentities(Utilities::get_post_option('title')), get_the_title(), + Utilities::get_option('title'), - htmlentities(Utilities::get_option('title')), $site_name ) ) ------------------------------------------------------------------------------------------------------------------------ Report type: All (Matching and Differences) Summary: 280 Line(s) match 3 Block(s) diff 3 : 3 Line(s) diff ------------------------------------------------------------------------------------------------------------------------
nicer than my first reflex
html_entity_decode(get_the_title(),ENT_QUOTES,'UTF-8'),
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Title twice encoded for get_the_title’ is closed to new replies.