| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Handles hooking CMB2 objects/fields into the WordPres REST API | |
| 3 | + * Handles hooking CMB2 objects/fields into the WordPress REST API | |
| 4 | 4 | * which can allow fields to be read and/or updated. |
| 5 | 5 | * |
| 6 | 6 | * @since 2.2.3 |
| 7 | 7 | * |
| @@ -706,12 +706,14 @@ | ||
| 706 | 706 | case 'post': |
| 707 | 707 | if ( isset( $object->ID ) ) { |
| 708 | 708 | return intval( $object->ID ); |
| 709 | 709 | } |
| 710 | + // no break | |
| 710 | 711 | case 'comment': |
| 711 | 712 | if ( isset( $object->comment_ID ) ) { |
| 712 | 713 | return intval( $object->comment_ID ); |
| 713 | 714 | } |
| 715 | + // no break | |
| 714 | 716 | case 'term': |
| 715 | 717 | if ( is_array( $object ) && isset( $object['term_id'] ) ) { |
| 716 | 718 | return intval( $object['term_id'] ); |
| 717 | 719 | } elseif ( isset( $object->term_id ) ) { |