Skip to content

Commit

Permalink
Add check to update post json api to handle null input type (#39676)
Browse files Browse the repository at this point in the history
* Update class.wpcom-json-api-update-post-v1-2-endpoint.php to handle null input type

* changelog
  • Loading branch information
darssen authored and gogdzl committed Oct 25, 2024
1 parent e17250e commit 5200252
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

JSON Endpoints: Handle null input for update post endpoint
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ public function write_post( $path, $blog_id, $post_id ) {
protected function should_load_theme_functions( $post_id = null ) {
if ( empty( $post_id ) ) {
$input = $this->input( true );
$type = $input['type'];
$type = $input['type'] ?? null;
} else {
$type = get_post_type( $post_id );
}
Expand Down

0 comments on commit 5200252

Please sign in to comment.