Skip to content

Commit

Permalink
Sync: Ensure a post object is returned (#13658)
Browse files Browse the repository at this point in the history
* Ensure object is a post before proceeding

* Pass through variable (reported by PHPCS)
  • Loading branch information
kraftbj authored and jeherve committed Oct 7, 2019
1 parent 6dfc387 commit 3c9d9df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/sync/src/modules/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ public function is_whitelisted_post_meta( $meta_key ) {
*/
public function is_post_type_allowed( $post_id ) {
$post = get_post( intval( $post_id ) );
if ( $post->post_type ) {

if ( isset( $post->post_type ) ) {
return ! in_array( $post->post_type, Settings::get_setting( 'post_types_blacklist' ), true );
}
return false;
Expand Down Expand Up @@ -665,6 +666,6 @@ public function expand_post_ids( $args ) {
* @return array|bool An array of min and max ids for each batch. FALSE if no table can be found.
*/
public function get_min_max_object_ids_for_batches( $batch_size, $where_sql = false ) {
return parent::get_min_max_object_ids_for_batches( $batch_size, $this->get_where_sql( false ) );
return parent::get_min_max_object_ids_for_batches( $batch_size, $this->get_where_sql( $where_sql ) );
}
}

0 comments on commit 3c9d9df

Please sign in to comment.