Skip to content

Commit

Permalink
Fix compatibility with other extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
rilwis committed Dec 6, 2022
1 parent b13055d commit 179992c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions inc/meta-box.php
Expand Up @@ -85,7 +85,7 @@ protected function global_hooks() {

/**
* Specific hooks for meta box object. Default is 'post'.
* This should be extended in sub-classes to support meta fields for terms, user, settings pages, etc.
* This should be extended in subclasses to support meta fields for terms, user, settings pages, etc.
*/
protected function object_hooks() {
// Add meta box.
Expand Down Expand Up @@ -267,7 +267,7 @@ public function validate() : bool {
&& wp_verify_nonce( $nonce, "rwmb-save-{$this->id}" );
}

public static function normalize( array $meta_box ) : array {
public static function normalize( $meta_box ) {
$default_title = __( 'Meta Box Title', 'meta-box' );
$meta_box = wp_parse_args( $meta_box, [
'title' => $default_title,
Expand Down Expand Up @@ -313,7 +313,7 @@ public static function normalize_fields( array $fields, $storage = null ) : arra

/**
* Check if meta box is saved before.
* This helps saving empty value in meta fields (text, check box, etc.) and set the correct default values.
* This helps to save empty value in meta fields (text, check box, etc.) and set the correct default values.
*/
public function is_saved() : bool {
foreach ( $this->fields as $field ) {
Expand Down Expand Up @@ -347,7 +347,7 @@ public function is_saved() : bool {
*
* @param ?WP_Screen $screen Screen object.
*/
public function is_edit_screen( $screen = null ) : bool {
public function is_edit_screen( $screen = null ) {
if ( ! ( $screen instanceof WP_Screen ) ) {
$screen = get_current_screen();
}
Expand Down Expand Up @@ -403,6 +403,6 @@ protected function get_real_object_id( $object_id ) {
}
$parent = wp_is_post_revision( $object_id );

return $parent ? $parent : $object_id;
return $parent ?: $object_id;
}
}

0 comments on commit 179992c

Please sign in to comment.