{"id":16213904,"date":"2022-11-19T03:16:12","date_gmt":"2022-11-19T03:16:12","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=16213904"},"modified":"2022-11-19T06:17:24","modified_gmt":"2022-11-19T06:17:24","slug":"better-function-check","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/better-function-check\/","title":{"rendered":"better function check"},"content":{"rendered":"<p>In class-pushpress.php there is a function publish_post<\/p>\n<p>this function calls $this-&gt;get_subscribers<\/p>\n<p>given that $this-&gt;get_subscribers can return false surely is is better to then wrap the foreach loops like this to prevent errors:<\/p>\n<p>if (!empty($subs)){<br \/>\n    \t\tforeach ( (array) $subs as $callback =&gt; $data ) {<br \/>\n    \t\t\tif ( $data[&#8216;is_active&#8217;] == FALSE )<br \/>\n    \t\t\t\tcontinue;<\/p>\n<p>    \t\t\t$this-&gt;schedule_ping( $callback, $post_id, &#8216;atom&#8217;, $data[&#8216;secret&#8217;] );<br \/>\n    \t\t}<br \/>\n\t\t}<\/p>\n","protected":false},"template":"","class_list":["post-16213904","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16213904","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":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16213904\/revisions"}],"predecessor-version":[{"id":16214080,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16213904\/revisions\/16214080"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16213904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}