From 2222ff25decf594ef912ac1d0790d1ba67813061 Mon Sep 17 00:00:00 2001 From: Alex Standiford Date: Sun, 9 May 2021 07:00:43 -0700 Subject: [PATCH] Corrects underpin autoloader --- lib/abstracts/Meta_Record_Type.php | 4 +++- lib/factories/Meta_Record_Type_Instance.php | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/abstracts/Meta_Record_Type.php b/lib/abstracts/Meta_Record_Type.php index 51c2a0d..fdee895 100644 --- a/lib/abstracts/Meta_Record_Type.php +++ b/lib/abstracts/Meta_Record_Type.php @@ -31,7 +31,9 @@ abstract class Meta_Record_Type { * * @since 1.0.0 */ - abstract public function sanitize( $meta_value, $meta_key, $object_type ); + public function sanitize( $meta_value, $meta_key, $object_type ){ + return $meta_value; + } /** * Callback that determines if this meta can be saved, or not. diff --git a/lib/factories/Meta_Record_Type_Instance.php b/lib/factories/Meta_Record_Type_Instance.php index d19115f..a4700de 100644 --- a/lib/factories/Meta_Record_Type_Instance.php +++ b/lib/factories/Meta_Record_Type_Instance.php @@ -23,7 +23,11 @@ public function __construct( $args ) { } public function sanitize( $meta_value, $meta_key, $object_type ) { - return $this->set_callable( $this->sanitize_callback, $meta_value, $meta_key, $object_type ); + if ( is_callable( $this->sanitize_callback ) ) { + return $this->set_callable( $this->sanitize_callback, $meta_value, $meta_key, $object_type ); + } + + return parent::sanitize( $meta_value, $meta_key, $object_type ); } public function has_permission() {