From 872562f319b9669a1ce7b61858f04cb6c2ca29ee Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Thu, 24 Sep 2020 09:25:10 -0300 Subject: [PATCH] Adds options to inner-options to take advantage of blocksy classes --- functions.php | 4 ++-- inc/options/single-elements/title-metadata.php | 4 ++-- template-parts/single-items-metadata.php | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/functions.php b/functions.php index c4ca344..26e2472 100644 --- a/functions.php +++ b/functions.php @@ -153,8 +153,8 @@ function blocksy_tainacan_custom_post_types_single_options( $options, $post_type ], false); if ( is_array($item_extra_options) ) { - $options['options'] = array_merge( - $options['options'], + $options['options'][$post_type . '_single_section_options']['inner-options'] = array_merge( + $options['options'][$post_type . '_single_section_options']['inner-options'], $item_extra_options ); } diff --git a/inc/options/single-elements/title-metadata.php b/inc/options/single-elements/title-metadata.php index 7a01aac..a336a3f 100644 --- a/inc/options/single-elements/title-metadata.php +++ b/inc/options/single-elements/title-metadata.php @@ -11,8 +11,8 @@ if (! isset($enabled)) { } $options = [ - $prefix . 'has_title_metadata' => [ - 'label' => __( 'Core title in the metadata list.', 'blocksy-tainacan' ), + $prefix . '_has_title_metadata' => [ + 'label' => __( 'Core title in the metadata list', 'blocksy-tainacan' ), 'type' => 'ct-switch', 'value' => $enabled, 'setting' => [ 'transport' => 'postMessage' ], diff --git a/template-parts/single-items-metadata.php b/template-parts/single-items-metadata.php index 868c790..2cb08a9 100644 --- a/template-parts/single-items-metadata.php +++ b/template-parts/single-items-metadata.php @@ -1,3 +1,6 @@ +screen->get_prefix(); +?>
@@ -24,9 +27,8 @@ 'after_title' => '', 'before_value' => '

', 'after_value' => '

', - 'exclude_title' => get_theme_mod('tainacan_single_item_hide_core_title_metadata', false) + 'exclude_title' => (get_theme_mod($prefix . '_has_title_metadata', 'yes') === 'no') ); - //$field = null; tainacan_the_metadata( $args ); ?>