{"id":14425442,"date":"2021-05-11T13:24:08","date_gmt":"2021-05-11T13:24:08","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/custom-function-conflicts-with-plugin\/"},"modified":"2021-05-11T13:24:08","modified_gmt":"2021-05-11T13:24:08","slug":"custom-function-conflicts-with-plugin","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/custom-function-conflicts-with-plugin\/","title":{"rendered":"custom function conflicts with plugin"},"content":{"rendered":"<p>I have a function that calls the latest comments but when I install your plugin it causes a fatal error.<br \/>\nWhat would I need to change to my function so that they don&#8217;t conflict?<\/p>\n<p>Here is my function which gets called in the sidebar<\/p>\n<pre><code>function bg_recent_comments($no_comments = 5, $comment_len = 80, $avatar_size = 48) {\n\t$comments_query = new WP_Comment_Query();\n\t$comments = $comments_query-&gt;query( array( &#039;number&#039; =&gt; $no_comments ) );\n\t$comm = &#039;&#039;;\n\tif ( $comments ) : foreach ( $comments as $comment ) :\n\t\t$comm .= &#039;&lt;div class=&quot;individual-comment&quot;&gt;Comment by &lt;a class=&quot;author&quot; href=&quot;&#039; . get_permalink( $comment-&gt;comment_post_ID ) . &#039;#comment-&#039; . $comment-&gt;comment_ID . &#039;&quot;&gt;&#039;;\n\t\t$comm .= get_comment_author( $comment-&gt;comment_ID ) . &#039;:&lt;\/a&gt; &#039;;\n\t\t$comm .= &#039;&lt;p&gt;&#039; . strip_tags( substr( apply_filters( &#039;get_comment_text&#039;, $comment-&gt;comment_content ), 0, $comment_len ) ) . &#039;...&lt;\/p&gt;&lt;\/div&gt;&#039;;\n\tendforeach; else :\n\t\t$comm .= &#039;No comments.&#039;;\n\tendif;\n\techo $comm;\t\n}<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-14425442","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14425442","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\/14425442\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14425442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}