We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ee4f3a commit b0b3a2eCopy full SHA for b0b3a2e
src/Post.php
@@ -4,8 +4,14 @@
4
use WP_Post;
5
6
class Post extends Base {
7
- public function update( $data, WP_Post $post ) {
8
- $this->update_values( $data, $post->ID, $post->post_type );
+ public function update( $data, $post ) {
+ if ( property_exists( $post, 'post_type' ) && 'product' === $post->post_type ) {
9
+ $post_id = $post->get_id();
10
+ } else {
11
+ $post_id = $post->ID;
12
+ }
13
+
14
+ $this->update_values( $data, $post_id, $post->post_type );
15
}
16
17
protected function get_types(): array {
0 commit comments