Ejemplo n.º 1
0
 /**
  * Verifies that both the post's status & type
  * are currently whitelisted
  *
  * @param  WordPress_GitHub_Sync_Post $post Post to verify.
  *
  * @return boolean                          True if supported, false if not.
  */
 protected function is_post_supported(WordPress_GitHub_Sync_Post $post)
 {
     if (wp_is_post_revision($post->id)) {
         return false;
     }
     // We need to allow trashed posts to be queried, but they are not whitelisted for export.
     if (!in_array($post->status(), $this->get_whitelisted_post_statuses()) && 'trash' !== $post->status()) {
         return false;
     }
     if (!in_array($post->type(), $this->get_whitelisted_post_types())) {
         return false;
     }
     if ($post->has_password()) {
         return false;
     }
     return true;
 }
Ejemplo n.º 2
0
 /**
  * Verifies that both the post's status & type
  * are currently whitelisted
  *
  * @param  WordPress_GitHub_Sync_Post  $post  post to verify
  * @return boolean                            true if supported, false if not
  */
 protected function is_post_supported($post)
 {
     if (!in_array($post->status(), $this->get_whitelisted_post_statuses())) {
         return false;
     }
     if (!in_array($post->type(), $this->get_whitelisted_post_types())) {
         return false;
     }
     if ($post->has_password()) {
         return false;
     }
     return true;
 }