diff --git a/src/includes/settings/class-settings.php b/src/includes/settings/class-settings.php index 4e1e658c..6090f6ae 100644 --- a/src/includes/settings/class-settings.php +++ b/src/includes/settings/class-settings.php @@ -41,6 +41,11 @@ public function get_option( $option_name ) { if (!$options) { $options = []; } + if( isset( $options[ 'enabled_post_types'] ) && ! empty( $options[ 'enabled_post_types'] ) ) { + if ( ! is_array( $options[ 'enabled_post_types'] ) ) { + $options[ 'enabled_post_types'] = explode( ',', trim( esc_textarea( $options[ 'enabled_post_types'] ) ) ); + } + } $options = array_merge($this->default_options, $options); if ( isset($options[$option_name]) ) { return $options[$option_name]; diff --git a/src/includes/settings/settings-page.php b/src/includes/settings/settings-page.php index 543a1c69..f86bb409 100644 --- a/src/includes/settings/settings-page.php +++ b/src/includes/settings/settings-page.php @@ -44,6 +44,13 @@ + + + + " type="text" id="enabled_post_types" value="get_option('enabled_post_types') ) ); ?>" class="regular-text"> + + +

diff --git a/src/includes/traits/class-singleton.php b/src/includes/traits/class-singleton.php index 36569679..428a8090 100644 --- a/src/includes/traits/class-singleton.php +++ b/src/includes/traits/class-singleton.php @@ -60,7 +60,7 @@ public function should_load_assets() { $should_load_assets = true; } - return $should_load_assets; + return apply_filters( 'jeo_should_load_assets' , $should_load_assets ); } final public static function get_instance() {