diff options
Diffstat (limited to 'plugins/jetpack/json-endpoints/class.wpcom-json-api-update-post-endpoint.php')
-rw-r--r-- | plugins/jetpack/json-endpoints/class.wpcom-json-api-update-post-endpoint.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-post-endpoint.php b/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-post-endpoint.php index bbcdd34e..80dccac6 100644 --- a/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-post-endpoint.php +++ b/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-post-endpoint.php @@ -537,7 +537,7 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { if ( $new ) { if ( $sitewide_likes_enabled ) { if ( false === $likes ) { - update_post_meta( $post_id, 'switch_like_status', 1 ); + update_post_meta( $post_id, 'switch_like_status', 0 ); } else { delete_post_meta( $post_id, 'switch_like_status' ); } @@ -552,7 +552,7 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { if ( isset( $likes ) ) { if ( $sitewide_likes_enabled ) { if ( false === $likes ) { - update_post_meta( $post_id, 'switch_like_status', 1 ); + update_post_meta( $post_id, 'switch_like_status', 0 ); } else { delete_post_meta( $post_id, 'switch_like_status' ); } @@ -759,7 +759,7 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { case 'add': if ( ! empty( $meta->id ) || ! empty( $meta->previous_value ) ) { - continue; + break; } elseif ( ! empty( $meta->key ) && ! empty( $meta->value ) && ( current_user_can( 'add_post_meta', $post_id, $unslashed_meta_key ) ) || WPCOM_JSON_API_Metadata::is_public( $meta->key ) ) { add_post_meta( $post_id, $meta->key, $meta->value ); } @@ -768,7 +768,7 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { case 'update': if ( ! isset( $meta->value ) ) { - continue; + break; } elseif ( ! empty( $meta->id ) && ! empty( $existing_meta_item->meta_key ) && ( current_user_can( 'edit_post_meta', $post_id, $unslashed_existing_meta_key ) || WPCOM_JSON_API_Metadata::is_public( $meta->key ) ) ) { update_metadata_by_mid( 'post', $meta->id, $meta->value ); } elseif ( ! empty( $meta->key ) && ! empty( $meta->previous_value ) && ( current_user_can( 'edit_post_meta', $post_id, $unslashed_meta_key ) || WPCOM_JSON_API_Metadata::is_public( $meta->key ) ) ) { |