From f56691fd7bff9e3902bd70276e4c97781b7a8876 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Wed, 30 Sep 2020 11:05:55 -0300 Subject: [PATCH] Adds section label options. --- .../single-elements/section-labels.php | 42 ++++++++++++++----- .../single-elements/show-thumbnail.php | 2 +- sass/tainacan-item-single.scss | 1 - template-parts/single-items-attachments.php | 6 +-- template-parts/single-items-document.php | 7 +++- template-parts/single-items-metadata.php | 4 +- 6 files changed, 42 insertions(+), 20 deletions(-) diff --git a/inc/options/single-elements/section-labels.php b/inc/options/single-elements/section-labels.php index cea5f1a..78d093b 100644 --- a/inc/options/single-elements/section-labels.php +++ b/inc/options/single-elements/section-labels.php @@ -12,7 +12,7 @@ if (! isset($enabled)) { $options = [ $prefix . 'display_section_labels' => [ - 'label' => __( 'Display section labels', 'blocksy' ), + 'label' => __( 'Display section labels', 'blocksy-tainacan' ), 'type' => 'ct-panel', 'switch' => true, 'value' => $enabled, @@ -20,16 +20,36 @@ $options = [ 'prefix' => $prefix, ]), 'inner-options' => [ - // $prefix . 'test_title_metadata' => [ - // 'label' => __( 'Test title in the metadata list', 'blocksy-tainacan' ), - // 'type' => 'ct-switch', - // 'value' => 'yes', - // 'setting' => [ 'transport' => 'postMessage' ], - // 'desc' => __( 'Toggle to hide or not the core title from the metadada list, as it already appears on the page title.', 'blocksy' ), - // 'sync' => blocksy_sync_single_post_container([ - // 'prefix' => $prefix - // ]) - // ] + $prefix . 'section_document_label' => [ + 'label' => __( 'Label for the "Document" section', 'blocksy-tainacan' ), + 'desc' => __( 'Leave it blank for not displaying any label.', 'blocksy-tainacan' ), + 'type' => 'text', + 'design' => 'block', + 'value' => __( 'Document', 'blocksy-tainacan' ), + 'sync' => blocksy_sync_single_post_container([ + 'prefix' => $prefix + ]) + ], + $prefix . 'section_attachments_label' => [ + 'label' => __( 'Label for the "Attachments" section', 'blocksy-tainacan' ), + 'desc' => __( 'Leave it blank for not displaying any label.', 'blocksy-tainacan' ), + 'type' => 'text', + 'design' => 'block', + 'value' => __( 'Attachments', 'blocksy-tainacan' ), + 'sync' => blocksy_sync_single_post_container([ + 'prefix' => $prefix + ]) + ], + $prefix . 'section_metadata_label' => [ + 'label' => __( 'Label for the "Metadata" section', 'blocksy-tainacan' ), + 'desc' => __( 'Leave it blank for not displaying any label.', 'blocksy-tainacan' ), + 'type' => 'text', + 'design' => 'block', + 'value' => __( 'Metadata', 'blocksy-tainacan' ), + 'sync' => blocksy_sync_single_post_container([ + 'prefix' => $prefix + ]) + ] ], ], ]; diff --git a/inc/options/single-elements/show-thumbnail.php b/inc/options/single-elements/show-thumbnail.php index 4c67397..a6ed837 100644 --- a/inc/options/single-elements/show-thumbnail.php +++ b/inc/options/single-elements/show-thumbnail.php @@ -16,7 +16,7 @@ $options = [ 'type' => 'ct-switch', 'value' => $enabled, 'setting' => [ 'transport' => 'postMessage' ], - 'desc' => __( 'Toggle to show or not the item thumbnail on the metadada list.', 'blocksy' ), + 'desc' => __( 'Toggle to show or not the item thumbnail on the metadada list.', 'blocksy-tainacan' ), 'sync' => blocksy_sync_single_post_container([ 'prefix' => $prefix ]) diff --git a/sass/tainacan-item-single.scss b/sass/tainacan-item-single.scss index 78a1cf2..eaeebeb 100644 --- a/sass/tainacan-item-single.scss +++ b/sass/tainacan-item-single.scss @@ -289,6 +289,5 @@ right: 10px; } } - } } \ No newline at end of file diff --git a/template-parts/single-items-attachments.php b/template-parts/single-items-attachments.php index 29be7eb..3d1b944 100644 --- a/template-parts/single-items-attachments.php +++ b/template-parts/single-items-attachments.php @@ -15,14 +15,14 @@ ) ); } + $prefix = blocksy_manager()->screen->get_prefix(); ?> -
- +

- +

diff --git a/template-parts/single-items-document.php b/template-parts/single-items-document.php index f3daab7..1f20ed1 100644 --- a/template-parts/single-items-document.php +++ b/template-parts/single-items-document.php @@ -1,8 +1,11 @@ +screen->get_prefix(); +?>
- +

- +

diff --git a/template-parts/single-items-metadata.php b/template-parts/single-items-metadata.php index 45fee0d..081fa41 100644 --- a/template-parts/single-items-metadata.php +++ b/template-parts/single-items-metadata.php @@ -2,9 +2,9 @@ $prefix = blocksy_manager()->screen->get_prefix(); ?>
- +

- +