Title: better function check
Last modified: November 19, 2022

---

# better function check

 *  [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/better-function-check/)
 * In class-pushpress.php there is a function publish_post
 * this function calls $this->get_subscribers
 * given that $this->get_subscribers can return false surely is is better to then
   wrap the foreach loops like this to prevent errors:
 * if (!empty($subs)){
    foreach ( (array) $subs as $callback => $data ) { if ( $
   data[‘is_active’] == FALSE ) continue;
 *  $this->schedule_ping( $callback, $post_id, ‘atom’, $data[‘secret’] );
    } }

The topic ‘better function check’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/pushpress.svg)
 * [PuSHPress](https://wordpress.org/plugins/pushpress/)
 * [Support Threads](https://wordpress.org/support/plugin/pushpress/)
 * [Active Topics](https://wordpress.org/support/plugin/pushpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pushpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pushpress/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/better-function-check/)
 * Status: not resolved