Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync: Ensure a post object is returned #13658

Merged
merged 2 commits into from
Oct 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ) );
}
}