{"id":7566256,"date":"2016-07-12T17:22:08","date_gmt":"2016-07-12T17:22:08","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/php-70-support\/"},"modified":"2016-09-01T16:32:25","modified_gmt":"2016-09-01T16:32:25","slug":"php-70-support","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-70-support\/","title":{"rendered":"PHP 7.0 Support"},"content":{"rendered":"<p>Hello,<br \/>\nJuste a quick post to let people know that this plugin has issue with PHP 7.0 because of a unsupported function.<br \/>\nThe error is :<br \/>\n<code>stderr: PHP message: PHP Warning: preg_replace(): The \/e modifier is no longer supported, use preg_replace_callback instead in \/wp-content\/plugins\/wordpress-faq-manager\/faq-manager.php on line 637<\/code><\/p>\n<p>To fix the issue, I updated lines 637 and 638 from:<\/p>\n<pre><code>$faq_topic\t= preg_replace(&#039;~&amp;#x0*([0-9a-f]+);~ei&#039;, &#039;chr(hexdec(&quot;\\\\1&quot;))&#039;, $faq_topic);\n$faq_tag\t= preg_replace(&#039;~&amp;#x0*([0-9a-f]+);~ei&#039;, &#039;chr(hexdec(&quot;\\\\1&quot;))&#039;, $faq_tag);<\/code><\/pre>\n<p>To<\/p>\n<pre><code>$faq_topic\t= preg_replace_callback(&#039;~&amp;#x0*([0-9a-f]+);~i&#039;, create_function(&#039;$matches&#039;,&#039;return chr(hexdec(&quot;\\\\1&quot;));&#039;),$faq_topic);\n$faq_tag\t= preg_replace_callback(&#039;~&amp;#x0*([0-9a-f]+);~i&#039;, create_function(&#039;$matches&#039;,&#039;return chr(hexdec(&quot;\\\\1&quot;));&#039;),$faq_tag);<\/code><\/pre>\n<p>I am not confident on this code as this was my first use of preg_replace_callback.<\/p>\n<p>That&#8217;s it, just left that here in case someone else had the same issue as me.<\/p>\n<p>Andrew please support PHP 7.0 if you update the plugin and let me know if this fix is incorrect, thank you.<\/p>\n<p>Regards,<br \/>\nKevin<\/p>\n<p>https:\/\/wordpress.org\/plugins\/wordpress-faq-manager\/<\/p>\n","protected":false},"template":"","class_list":["post-7566256","topic","type-topic","status-publish","hentry","topic-tag-php-7"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7566256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7566256\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=7566256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}