/** * Check for a publish action from the meta box. * * @since 0.9.0 * @param int $post_id * @param WP_Post $post * @access public */ public function do_publish($post_id, $post) { // Check if the values we want are present in $_REQUEST params. if (empty($_POST['apple_news_publish_action']) || empty($_POST['apple_news_publish_nonce']) || empty($_POST['post_ID'])) { return; } // Check the nonce if (!wp_verify_nonce($_POST['apple_news_publish_nonce'], $this->publish_action)) { return; } // Do the publish $post_sync = new Admin_Apple_Post_Sync($this->settings); $post_sync->do_publish($post_id, $post); }