Skip to content

Commit

Permalink
Merge pull request #694 from Agilicus/defensive
Browse files Browse the repository at this point in the history
fix: defensively check for null post in add_fields() for php 8.3
  • Loading branch information
balexey88 authored Jan 18, 2024
2 parents 630885d + 5655d7a commit d7c1c2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vendor/wpmetabox/meta-box/inc/media-modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public function get_fields() {
*
* @return mixed
*/
public function add_fields( $form_fields, WP_Post $post ) {
public function add_fields( $form_fields, ?WP_Post $post ) {
if (is_null($post)) {
return $form_fields;
}
if ( $this->is_attachment_edit_screen() ) {
return $form_fields;
}
Expand Down

0 comments on commit d7c1c2a

Please sign in to comment.