Version 0.1.3: Renames plugin to Tainacan Support for Blocksy

This commit is contained in:
mateuswetah 2021-04-14 14:40:23 -03:00
parent 2de46b288b
commit 070b988a26
71 changed files with 334 additions and 331 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
blocksy-tainacan/*/node_modules tainacan-blocksy/*/node_modules
.vscode .vscode

View File

@ -1,4 +1,4 @@
# Blocksy Tainacan # Tainacan Support for Blocksy
This plugin integrates Tainacan pages with Blocksy theme. This plugin integrates Tainacan pages with Blocksy theme.
@ -31,7 +31,7 @@ To, besides that, move the necessary plugin files to your wordpress plugin direc
If you don't like the script you can bundle things by yourself: If you don't like the script you can bundle things by yourself:
```sh ```sh
cd blocksy-tainacan cd tainacan-blocksy
npm install npm install
npm run build npm run build
``` ```
@ -57,7 +57,7 @@ Then you just have to enable Blocksy theme and have fun ;)
Just go to `functions.php` file and set the constant as you prefer: Just go to `functions.php` file and set the constant as you prefer:
```php ```php
const BLOCKSY_TAINACAN_IS_CHILD_THEME = true; const TAINACAN_BLOCKSY_IS_CHILD_THEME = true;
``` ```
Then move all files to a folder inside WordPress themes folder (`wp-content/themes`); Then move all files to a folder inside WordPress themes folder (`wp-content/themes`);

View File

@ -1,48 +0,0 @@
<?php
/*
Plugin Name: Blocksy Tainacan
Plugin URI: https://tainacan.org/
Description: Tainacan support for Blocksy theme
Author: tainacan
Version: 0.1.2
Text Domain: blocksy-tainacan
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
if (! defined('WP_DEBUG') ) {
die( 'Direct access forbidden.' );
}
/** Theme/plugin version */
const BLOCKSY_TAINACAN_VERSION = '0.1.2';
const BLOCKSY_TAINACAN_IS_CHILD_THEME = false;
/* Tools to define our next constants */
require 'utils.php';
$plugin_root_url = blocksy_tainacan_get_plugin_dir_url();
define('BLOCKSY_TAINACAN_PLUGIN_URL_PATH', $plugin_root_url);
$plugin_root_dir = blocksy_tainacan_get_plugin_dir_path();
define('BLOCKSY_TAINACAN_PLUGIN_DIR_PATH', $plugin_root_dir);
$blocksy_tainacan_is_blocksy_activated = blocksy_tainacan_is_blocksy_activated();
define('BLOCKSY_TAINACAN_IS_BLOCKSY_ACTIVATED', $blocksy_tainacan_is_blocksy_activated);
/* This should only be used if we're in the child theme or if is a plugin and blocksy theme is installed */
if ( BLOCKSY_TAINACAN_IS_CHILD_THEME || ( BLOCKSY_TAINACAN_IS_BLOCKSY_ACTIVATED && !BLOCKSY_TAINACAN_IS_CHILD_THEME ) ) {
/* Basic styles and script enqueues */
require BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/enqueues.php';
/* Template redirection necessary only if in a plugin */
if ( !BLOCKSY_TAINACAN_IS_CHILD_THEME ) {
require BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/plugin.php';
}
/* Requires several settings, functions and helpers */
require BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/integration.php';
require BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/customizer.php';
require BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/navigation.php';
}

View File

@ -1,46 +0,0 @@
<?php
if (! isset($prefix)) {
$prefix = '';
} else {
$prefix = $prefix . '_';
}
$options = [
$prefix . 'page_structure_type' => [
'label' => false,
'type' => 'ct-image-picker',
'value' => 'type-dam',
'design' => 'block',
'setting' => [ 'transport' => 'postMessage' ],
'choices' => [
'type-dam' => [
'src' => blocksy_tainacan_image_picker_url( 'type-dam.svg' ),
'title' => __( 'Document, Attachments, Metadata', 'blocksy-tainacan' ),
],
'type-dma' => [
'src' => blocksy_tainacan_image_picker_url( 'type-dma.svg' ),
'title' => __( 'Document, Metadata, Attachments', 'blocksy-tainacan' ),
],
'type-mda' => [
'src' => blocksy_tainacan_image_picker_url( 'type-mda.svg' ),
'title' => __( 'Metadata, Document, Attachments', 'blocksy-tainacan' ),
],
'type-gm' => [
'src' => blocksy_tainacan_image_picker_url( 'type-gm.svg' ),
'title' => __( 'Metadata to the right', 'blocksy-tainacan' ),
],
'type-mg' => [
'src' => blocksy_tainacan_image_picker_url( 'type-mg.svg' ),
'title' => __( 'Metadata to the left', 'blocksy-tainacan' ),
],
],
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
];

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
echo "Compiling necessary stuff..." echo "Compiling necessary stuff..."
cd ./blocksy-tainacan cd ./tainacan-blocksy
npm install npm install
npm run build npm run build
cd ../ cd ../
@ -9,12 +9,12 @@ then
echo "Done!" echo "Done!"
else else
echo "Done. Moving files to destination folder: $1" echo "Done. Moving files to destination folder: $1"
rm -rf $1/blocksy-tainacan rm -rf $1/tainacan-blocksy
cp -r ./blocksy-tainacan $1 cp -r ./tainacan-blocksy $1
echo "Cleaning some files not necessary for the plugin to work..." echo "Cleaning some files not necessary for the plugin to work..."
rm -f $1/blocksy-tainacan/package.json rm -f $1/tainacan-blocksy/package.json
rm -f $1/blocksy-tainacan/package-lock.json rm -f $1/tainacan-blocksy/package-lock.json
rm -rf $1/blocksy-tainacan/node_modules rm -rf $1/tainacan-blocksy/node_modules
rm -rf $1/blocksy-tainacan/sass rm -rf $1/tainacan-blocksy/sass
echo "Done!" echo "Done!"
fi fi

View File

@ -1,4 +1,4 @@
=== Blocksy Tainacan === === Tainacan Support for Blocksy ===
Author: tainacan Author: tainacan
Contributors: wetah, vnmedeiros, leogermani, tainacan Contributors: wetah, vnmedeiros, leogermani, tainacan
Tags: museums, libraries, archives, GLAM, collections, repository, tainacan, blocksy Tags: museums, libraries, archives, GLAM, collections, repository, tainacan, blocksy
@ -44,12 +44,15 @@ Also, this plugin will only work with [Blocksy theme](https://wordpress.org/them
== Copyright == == Copyright ==
Blocksy Tainacan, Copyright 2021 Tainacan.org Tainacan Support for Blocksy, Copyright 2021 Tainacan.org
Blocksy Tainacan plugin is distributed under the terms of the GNU GPLv3 Tainacan Support for Blocksy plugin is distributed under the terms of the GNU GPLv3
License details: https://github.com/tainacan/blocksy-tainacan/blob/master/LICENSE License details: https://github.com/tainacan/blocksy-tainacan/blob/master/LICENSE
== Changelog == == Changelog ==
= 0.1.3 =
* Changes name to avoid trademark issues
= 0.1.2 = = 0.1.2 =
* First release on the WordPress.org plugins repository * First release on the WordPress.org plugins repository

View File

@ -0,0 +1,48 @@
<?php
/*
Plugin Name: Tainacan Support for Blocksy
Plugin URI: https://tainacan.org/
Description: Tainacan plugin support for Blocksy theme
Author: tainacan
Version: 0.1.3
Text Domain: tainacan-blocksy
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
if (! defined('WP_DEBUG') ) {
die( 'Direct access forbidden.' );
}
/** Theme/plugin version */
const TAINACAN_BLOCKSY_VERSION = '0.1.3';
const TAINACAN_BLOCKSY_IS_CHILD_THEME = false;
/* Tools to define our next constants */
require 'utils.php';
$plugin_root_url = tainacan_blocksy_get_plugin_dir_url();
define('TAINACAN_BLOCKSY_PLUGIN_URL_PATH', $plugin_root_url);
$plugin_root_dir = tainacan_blocksy_get_plugin_dir_path();
define('TAINACAN_BLOCKSY_PLUGIN_DIR_PATH', $plugin_root_dir);
$tainacan_blocksy_is_blocksy_activated = tainacan_blocksy_is_blocksy_activated();
define('TAINACAN_BLOCKSY_IS_BLOCKSY_ACTIVATED', $tainacan_blocksy_is_blocksy_activated);
/* This should only be used if we're in the child theme or if is a plugin and blocksy theme is installed */
if ( TAINACAN_BLOCKSY_IS_CHILD_THEME || ( TAINACAN_BLOCKSY_IS_BLOCKSY_ACTIVATED && !TAINACAN_BLOCKSY_IS_CHILD_THEME ) ) {
/* Basic styles and script enqueues */
require TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/enqueues.php';
/* Template redirection necessary only if in a plugin */
if ( !TAINACAN_BLOCKSY_IS_CHILD_THEME ) {
require TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/plugin.php';
}
/* Requires several settings, functions and helpers */
require TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/integration.php';
require TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/customizer.php';
require TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/navigation.php';
}

View File

@ -3,48 +3,48 @@
/** /**
* Adds Tainacan repository and term items list to settings on customizer. * Adds Tainacan repository and term items list to settings on customizer.
*/ */
if ( !function_exists('blocksy_tainacan_add_repository_and_terms_items_options_panel') ) { if ( !function_exists('tainacan_blocksy_add_repository_and_terms_items_options_panel') ) {
function blocksy_tainacan_add_repository_and_terms_items_options_panel($options) { function tainacan_blocksy_add_repository_and_terms_items_options_panel($options) {
$options['tainacan_repository_items_list'] = blc_call_fnc( $options['tainacan_repository_items_list'] = blc_call_fnc(
[ [
'fnc' => 'blocksy_get_options', 'fnc' => 'blocksy_get_options',
'default' => 'array' 'default' => 'array'
], ],
BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/archives/tainacan-repository-items.php', TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/archives/tainacan-repository-items.php',
[], false [], false
); );
return $options; return $options;
} }
} }
add_filter( 'blocksy_extensions_customizer_options', 'blocksy_tainacan_add_repository_and_terms_items_options_panel' ); add_filter( 'blocksy_extensions_customizer_options', 'tainacan_blocksy_add_repository_and_terms_items_options_panel' );
/** /**
* Adds Tainacan terms and term items list to settings on customizer. * Adds Tainacan terms and term items list to settings on customizer.
*/ */
if ( !function_exists('blocksy_tainacan_add_terms_and_terms_items_options_panel') ) { if ( !function_exists('tainacan_blocksy_add_terms_and_terms_items_options_panel') ) {
function blocksy_tainacan_add_terms_and_terms_items_options_panel($options) { function tainacan_blocksy_add_terms_and_terms_items_options_panel($options) {
$options['tainacan_terms_items_list'] = blc_call_fnc( $options['tainacan_terms_items_list'] = blc_call_fnc(
[ [
'fnc' => 'blocksy_get_options', 'fnc' => 'blocksy_get_options',
'default' => 'array' 'default' => 'array'
], ],
BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/archives/tainacan-terms-items.php', TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/archives/tainacan-terms-items.php',
[], false [], false
); );
return $options; return $options;
} }
} }
add_filter( 'blocksy_extensions_customizer_options', 'blocksy_tainacan_add_terms_and_terms_items_options_panel' ); add_filter( 'blocksy_extensions_customizer_options', 'tainacan_blocksy_add_terms_and_terms_items_options_panel' );
/** /**
* Adds extra customizer options to items single page template * Adds extra customizer options to items single page template
*/ */
if ( !function_exists('blocksy_tainacan_custom_post_types_single_options') ) { if ( !function_exists('tainacan_blocksy_custom_post_types_single_options') ) {
function blocksy_tainacan_custom_post_types_single_options( $options, $post_type, $post_type_object ) { function tainacan_blocksy_custom_post_types_single_options( $options, $post_type, $post_type_object ) {
// This should only happen if we have Tainacan plugin installed // This should only happen if we have Tainacan plugin installed
if ( defined ('TAINACAN_VERSION') ) { if ( defined ('TAINACAN_VERSION') ) {
@ -54,12 +54,12 @@ if ( !function_exists('blocksy_tainacan_custom_post_types_single_options') ) {
// Change the section title in the customizer // Change the section title in the customizer
$options['title'] = sprintf( $options['title'] = sprintf(
__('Item from %s', 'blocksy-tainacan'), __('Item from %s', 'tainacan-blocksy'),
$post_type_object->labels->name $post_type_object->labels->name
); );
// Extra options to the single item template // Extra options to the single item template
$item_extra_options = blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/posts/tainacan-item-single.php', [ $item_extra_options = blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/posts/tainacan-item-single.php', [
'post_type' => $post_type_object, 'post_type' => $post_type_object,
'is_general_cpt' => true 'is_general_cpt' => true
], false); ], false);
@ -79,14 +79,14 @@ if ( !function_exists('blocksy_tainacan_custom_post_types_single_options') ) {
return $options; return $options;
} }
} }
add_filter( 'blocksy:custom_post_types:single-options', 'blocksy_tainacan_custom_post_types_single_options', 10, 3 ); add_filter( 'blocksy:custom_post_types:single-options', 'tainacan_blocksy_custom_post_types_single_options', 10, 3 );
/** /**
* Adds extra customizer options to items single page template * Adds extra customizer options to items single page template
*/ */
if ( !function_exists('blocksy_tainacan_custom_post_types_archive_options') ) { if ( !function_exists('tainacan_blocksy_custom_post_types_archive_options') ) {
function blocksy_tainacan_custom_post_types_archive_options( $options, $post_type, $post_type_object ) { function tainacan_blocksy_custom_post_types_archive_options( $options, $post_type, $post_type_object ) {
// This should only happen if we have Tainacan plugin installed // This should only happen if we have Tainacan plugin installed
if ( defined ('TAINACAN_VERSION') ) { if ( defined ('TAINACAN_VERSION') ) {
@ -96,12 +96,12 @@ if ( !function_exists('blocksy_tainacan_custom_post_types_archive_options') ) {
// Change the section title in the customizer // Change the section title in the customizer
$options['title'] = sprintf( $options['title'] = sprintf(
__('Items list from %s', 'blocksy-tainacan'), __('Items list from %s', 'tainacan-blocksy'),
$post_type_object->labels->name $post_type_object->labels->name
); );
// Extra options to the archive items list // Extra options to the archive items list
$items_extra_options = blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/posts/tainacan-item-archive.php', [ $items_extra_options = blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/posts/tainacan-item-archive.php', [
'prefix' => $post_type_object->name, 'prefix' => $post_type_object->name,
'is_general_cpt' => true 'is_general_cpt' => true
], false); ], false);
@ -115,14 +115,14 @@ if ( !function_exists('blocksy_tainacan_custom_post_types_archive_options') ) {
return $options; return $options;
} }
} }
add_filter( 'blocksy:custom_post_types:archive-options', 'blocksy_tainacan_custom_post_types_archive_options', 10, 3 ); add_filter( 'blocksy:custom_post_types:archive-options', 'tainacan_blocksy_custom_post_types_archive_options', 10, 3 );
/** /**
* Removes tainacan metadatum and filters from the custom metadata options in the customizer controller. * Removes tainacan metadatum and filters from the custom metadata options in the customizer controller.
*/ */
if ( !function_exists('blocksy_tainacan_custom_post_types_supported_list') ) { if ( !function_exists('tainacan_blocksy_custom_post_types_supported_list') ) {
function blocksy_tainacan_custom_post_types_supported_list( $potential_post_types ) { function tainacan_blocksy_custom_post_types_supported_list( $potential_post_types ) {
// This should only happen if we have Tainacan plugin installed // This should only happen if we have Tainacan plugin installed
if ( defined ('TAINACAN_VERSION') ) { if ( defined ('TAINACAN_VERSION') ) {
@ -133,13 +133,13 @@ if ( !function_exists('blocksy_tainacan_custom_post_types_supported_list') ) {
return $potential_post_types; return $potential_post_types;
} }
} }
add_filter( 'blocksy:custom_post_types:supported_list', 'blocksy_tainacan_custom_post_types_supported_list', 10 ); add_filter( 'blocksy:custom_post_types:supported_list', 'tainacan_blocksy_custom_post_types_supported_list', 10 );
/** /**
* Renders the item single page with a custom template that will use most of Blocksy features * Renders the item single page with a custom template that will use most of Blocksy features
*/ */
if ( !function_exists('blocksy_tainacan_the_content_for_items') ) { if ( !function_exists('tainacan_blocksy_the_content_for_items') ) {
function blocksy_tainacan_the_content_for_items( $content ) { function tainacan_blocksy_the_content_for_items( $content ) {
// This should only happen if we have Tainacan plugin installed // This should only happen if we have Tainacan plugin installed
if ( defined ('TAINACAN_VERSION') ) { if ( defined ('TAINACAN_VERSION') ) {
@ -148,13 +148,13 @@ if ( !function_exists('blocksy_tainacan_the_content_for_items') ) {
// Check if we're inside the main loop in a single Post. // Check if we're inside the main loop in a single Post.
if (in_array($post_type, $collections_post_types) && is_singular() && in_the_loop() && is_main_query() ) { if (in_array($post_type, $collections_post_types) && is_singular() && in_the_loop() && is_main_query() ) {
return blocksy_tainacan_get_template_part( 'tainacan/item-single-page' ); return tainacan_blocksy_get_template_part( 'tainacan/item-single-page' );
} }
} }
return $content; return $content;
} }
} }
add_filter( 'the_content', 'blocksy_tainacan_the_content_for_items', 11); add_filter( 'the_content', 'tainacan_blocksy_the_content_for_items', 11);
?> ?>

View File

@ -4,23 +4,23 @@
* Enqueues styles and scripts * Enqueues styles and scripts
* Some JS files here are only necessary for Tainacan Item pages * Some JS files here are only necessary for Tainacan Item pages
*/ */
function blocksy_tainacan_enqueue_scripts() { function tainacan_blocksy_enqueue_scripts() {
// First, we enqueue parent theme styles // First, we enqueue parent theme styles
if ( BLOCKSY_TAINACAN_IS_CHILD_THEME ) if ( TAINACAN_BLOCKSY_IS_CHILD_THEME )
wp_enqueue_style( 'blocksy-parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'blocksy-parent-style', get_template_directory_uri() . '/style.css' );
// Then, this child theme styles // Then, this child theme styles
wp_enqueue_style( 'tainacan-blocksy-style', wp_enqueue_style( 'tainacan-blocksy-style',
BLOCKSY_TAINACAN_PLUGIN_URL_PATH . '/style.min.css', TAINACAN_BLOCKSY_PLUGIN_URL_PATH . '/style.min.css',
!BLOCKSY_TAINACAN_IS_CHILD_THEME ? array() : array( 'blocksy-parent-style' ), !TAINACAN_BLOCKSY_IS_CHILD_THEME ? array() : array( 'blocksy-parent-style' ),
BLOCKSY_TAINACAN_VERSION TAINACAN_BLOCKSY_VERSION
); );
// Now, some dynamic css that is generated using blocksy dynamic css logic // Now, some dynamic css that is generated using blocksy dynamic css logic
add_action('blocksy:global-dynamic-css:enqueue', function ($args) { add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
blocksy_theme_get_dynamic_styles(array_merge([ blocksy_theme_get_dynamic_styles(array_merge([
'path' => BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/global.php', 'path' => TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/global.php',
'chunk' => 'global', 'chunk' => 'global',
'forced_call' => true 'forced_call' => true
], $args)); ], $args));
@ -31,16 +31,16 @@ function blocksy_tainacan_enqueue_scripts() {
$collections_post_types = \Tainacan\Repositories\Repository::get_collections_db_identifiers(); $collections_post_types = \Tainacan\Repositories\Repository::get_collections_db_identifiers();
$post_type = get_post_type(); $post_type = get_post_type();
wp_enqueue_script( 'blocksy-tainacan-scripts', BLOCKSY_TAINACAN_PLUGIN_URL_PATH . '/js/scripts.js', array(), BLOCKSY_TAINACAN_VERSION, true ); wp_enqueue_script( 'tainacan-blocksy-scripts', TAINACAN_BLOCKSY_PLUGIN_URL_PATH . '/js/scripts.js', array(), TAINACAN_BLOCKSY_VERSION, true );
} }
} }
add_action( 'wp_enqueue_scripts', 'blocksy_tainacan_enqueue_scripts' ); add_action( 'wp_enqueue_scripts', 'tainacan_blocksy_enqueue_scripts' );
/** /**
* Enqueues front-end CSS for the items page fixed filters logic. * Enqueues front-end CSS for the items page fixed filters logic.
*/ */
if ( !function_exists('blocksy_tainacan_items_page_filters_fixed_on_scroll_output') ) { if ( !function_exists('tainacan_blocksy_items_page_filters_fixed_on_scroll_output') ) {
function blocksy_tainacan_items_page_filters_fixed_on_scroll_output() { function tainacan_blocksy_items_page_filters_fixed_on_scroll_output() {
$prefix = blocksy_manager()->screen->get_prefix(); $prefix = blocksy_manager()->screen->get_prefix();
$should_use_fixed_filters_logic = (version_compare(TAINACAN_VERSION, '0.17') >= 0) && get_theme_mod( $prefix . '_filters_fixed_on_scroll', 'no' ) == 'yes'; $should_use_fixed_filters_logic = (version_compare(TAINACAN_VERSION, '0.17') >= 0) && get_theme_mod( $prefix . '_filters_fixed_on_scroll', 'no' ) == 'yes';
@ -76,6 +76,6 @@ if ( !function_exists('blocksy_tainacan_items_page_filters_fixed_on_scroll_outpu
} }
} }
add_action( 'wp_head', 'blocksy_tainacan_items_page_filters_fixed_on_scroll_output'); add_action( 'wp_head', 'tainacan_blocksy_items_page_filters_fixed_on_scroll_output');
?> ?>

View File

@ -35,8 +35,8 @@ if (! function_exists('blc_call_fnc')) {
* *
* @param string $path image name. * @param string $path image name.
*/ */
if (! function_exists('blocksy_tainacan_image_picker_url')) { if (! function_exists('tainacan_blocksy_image_picker_url')) {
function blocksy_tainacan_image_picker_url($path) { function tainacan_blocksy_image_picker_url($path) {
return BLOCKSY_TAINACAN_PLUGIN_URL_PATH . '/static/images/' . $path; return TAINACAN_BLOCKSY_PLUGIN_URL_PATH . '/static/images/' . $path;
} }
} }

View File

@ -3,8 +3,8 @@
/** /**
* Retrieves an item adjacent link, either using WP strategy or Tainacan plugin tainacan_get_adjacent_items() * Retrieves an item adjacent link, either using WP strategy or Tainacan plugin tainacan_get_adjacent_items()
*/ */
if ( !function_exists('blocksy_tainacan_get_adjacent_item_links') ) { if ( !function_exists('tainacan_blocksy_get_adjacent_item_links') ) {
function blocksy_tainacan_get_adjacent_item_links() { function tainacan_blocksy_get_adjacent_item_links() {
$prefix = blocksy_manager()->screen->get_prefix(); $prefix = blocksy_manager()->screen->get_prefix();
@ -83,7 +83,7 @@ if ( !function_exists('blocksy_tainacan_get_adjacent_item_links') ) {
'<a href="' . $previous_link_url .'" rel="prev" class="nav-item-prev"> ' . '<a href="' . $previous_link_url .'" rel="prev" class="nav-item-prev"> ' .
($has_thumb ? $previous_post_image_output : '') . ($has_thumb ? $previous_post_image_output : '') .
'<div class="item-content">' . '<div class="item-content">' .
'<span class="item-label">' . __( 'Previous item', 'blocksy-tainacan' ) . '</span>' . '<span class="item-label">' . __( 'Previous item', 'tainacan-blocksy' ) . '</span>' .
(( !empty( $previous_title ) && $has_title ) ? ('<span class="item-title">' . $previous_title . '</span>') : '') . (( !empty( $previous_title ) && $has_title ) ? ('<span class="item-title">' . $previous_title . '</span>') : '') .
'</div>'. '</div>'.
'</a>'); '</a>');
@ -91,7 +91,7 @@ if ( !function_exists('blocksy_tainacan_get_adjacent_item_links') ) {
$next = $next_link_url === false ? '' : ( $next = $next_link_url === false ? '' : (
'<a href="' . $next_link_url .'" rel="prev" class="nav-item-next"> ' . '<a href="' . $next_link_url .'" rel="prev" class="nav-item-next"> ' .
'<div class="item-content">' . '<div class="item-content">' .
'<span class="item-label">' . __( 'Next item', 'blocksy-tainacan') . '</span>' . '<span class="item-label">' . __( 'Next item', 'tainacan-blocksy') . '</span>' .
(( !empty( $next_title ) && $has_title) ? ('<span class="item-title">' . $next_title . '</span>') : '') . (( !empty( $next_title ) && $has_title) ? ('<span class="item-title">' . $next_title . '</span>') : '') .
'</div>' . '</div>' .
($has_thumb ? $next_post_image_output : '') . ($has_thumb ? $next_post_image_output : '') .
@ -261,8 +261,8 @@ if ( !function_exists('blocksy_default_post_navigation') ) {
/** /**
* Outputs Tainacan custom logic for items navigation with blocksy features * Outputs Tainacan custom logic for items navigation with blocksy features
*/ */
if ( !function_exists('blocksy_tainacan_item_navigation') ) { if ( !function_exists('tainacan_blocksy_item_navigation') ) {
function blocksy_tainacan_item_navigation() { function tainacan_blocksy_item_navigation() {
$next = ''; $next = '';
$previous = ''; $previous = '';
$prefix = blocksy_manager()->screen->get_prefix(); $prefix = blocksy_manager()->screen->get_prefix();
@ -290,7 +290,7 @@ if ( !function_exists('blocksy_tainacan_item_navigation') ) {
'previous' => '' 'previous' => ''
]; ];
$adjacent_links = blocksy_tainacan_get_adjacent_item_links(); $adjacent_links = tainacan_blocksy_get_adjacent_item_links();
$previous = $adjacent_links['previous']; $previous = $adjacent_links['previous'];
$next = $adjacent_links['next']; $next = $adjacent_links['next'];
@ -321,8 +321,8 @@ if ( !function_exists('blocksy_tainacan_item_navigation') ) {
* has already declared the function in the plugin lifecycle, somehting that * has already declared the function in the plugin lifecycle, somehting that
* is not necessary if on a child theme. * is not necessary if on a child theme.
*/ */
if (!BLOCKSY_TAINACAN_IS_CHILD_THEME) { if (!TAINACAN_BLOCKSY_IS_CHILD_THEME) {
function blocksy_tainacan_after_theme_setup() { function tainacan_blocksy_after_theme_setup() {
/** /**
* Overrides parent theme blocksy post navigation logic to handle items navigation * Overrides parent theme blocksy post navigation logic to handle items navigation
@ -336,13 +336,13 @@ if (!BLOCKSY_TAINACAN_IS_CHILD_THEME) {
// Check if we're inside the main loop in a single Post. // Check if we're inside the main loop in a single Post.
if (in_array($post_type, $collections_post_types) && is_singular() && in_the_loop() && is_main_query() ) { if (in_array($post_type, $collections_post_types) && is_singular() && in_the_loop() && is_main_query() ) {
return blocksy_tainacan_item_navigation(); return tainacan_blocksy_item_navigation();
} }
} }
return blocksy_default_post_navigation(); return blocksy_default_post_navigation();
} }
} }
add_action( 'plugins_loaded', 'blocksy_tainacan_after_theme_setup' ); add_action( 'plugins_loaded', 'tainacan_blocksy_after_theme_setup' );
} else { } else {
/** /**
* Overrides parent theme blocksy post navigation logic to handle items navigation * Overrides parent theme blocksy post navigation logic to handle items navigation
@ -356,7 +356,7 @@ if (!BLOCKSY_TAINACAN_IS_CHILD_THEME) {
// Check if we're inside the main loop in a single Post. // Check if we're inside the main loop in a single Post.
if (in_array($post_type, $collections_post_types) && is_singular() && in_the_loop() && is_main_query() ) { if (in_array($post_type, $collections_post_types) && is_singular() && in_the_loop() && is_main_query() ) {
return blocksy_tainacan_item_navigation(); return tainacan_blocksy_item_navigation();
} }
} }
return blocksy_default_post_navigation(); return blocksy_default_post_navigation();
@ -366,8 +366,8 @@ if (!BLOCKSY_TAINACAN_IS_CHILD_THEME) {
/** /**
* Uses Blocksy filter to customize the related posts logic on Tainacan Items page. (NOT IN USE YET) * Uses Blocksy filter to customize the related posts logic on Tainacan Items page. (NOT IN USE YET)
*/ */
if ( !function_exists('blocksy_tainacan_custom_related_posts_query') ) { if ( !function_exists('tainacan_blocksy_custom_related_posts_query') ) {
function blocksy_tainacan_custom_related_posts_query( $related_posts_query ) { function tainacan_blocksy_custom_related_posts_query( $related_posts_query ) {
// This should only happen if we have Tainacan plugin installed // This should only happen if we have Tainacan plugin installed
if ( defined ('TAINACAN_VERSION') ) { if ( defined ('TAINACAN_VERSION') ) {
@ -382,14 +382,14 @@ if ( !function_exists('blocksy_tainacan_custom_related_posts_query') ) {
return $related_posts_query; return $related_posts_query;
} }
} }
//add_filter( 'blocksy:related-posts:query-args', 'blocksy_tainacan_custom_related_posts_query', 10 ); //add_filter( 'blocksy:related-posts:query-args', 'tainacan_blocksy_custom_related_posts_query', 10 );
/** /**
* Uses Blocksy filter to add custom link on the item breadcrumb * Uses Blocksy filter to add custom link on the item breadcrumb
*/ */
if ( !function_exists('blocksy_tainacan_custom_breadcrumbs') ) { if ( !function_exists('tainacan_blocksy_custom_breadcrumbs') ) {
function blocksy_tainacan_custom_breadcrumbs( $array ) { function tainacan_blocksy_custom_breadcrumbs( $array ) {
// This should only happen if we have Tainacan plugin installed // This should only happen if we have Tainacan plugin installed
if ( defined ('TAINACAN_VERSION') ) { if ( defined ('TAINACAN_VERSION') ) {
@ -424,6 +424,6 @@ if ( !function_exists('blocksy_tainacan_custom_breadcrumbs') ) {
return $array; return $array;
} }
} }
add_filter( 'blocksy:breadcrumbs:items-array', 'blocksy_tainacan_custom_breadcrumbs', 10, 3 ); add_filter( 'blocksy:breadcrumbs:items-array', 'tainacan_blocksy_custom_breadcrumbs', 10, 3 );
?> ?>

View File

@ -11,7 +11,7 @@ if (! isset($prefix)) {
$options = [ $options = [
$prefix . 'items_list_background_palette' => [ $prefix . 'items_list_background_palette' => [
'label' => __( 'Background color palette', 'blocksy-tainacan' ), 'label' => __( 'Background color palette', 'tainacan-blocksy' ),
'type' => 'ct-color-palettes-picker', 'type' => 'ct-color-palettes-picker',
'design' => 'block', 'design' => 'block',
// translators: The interpolations addes a html link around the word. // translators: The interpolations addes a html link around the word.
@ -73,7 +73,7 @@ $options = [
], ],
$prefix . 'items_list_text_palette' => [ $prefix . 'items_list_text_palette' => [
'label' => __( 'Text color palette', 'blocksy-tainacan' ), 'label' => __( 'Text color palette', 'tainacan-blocksy' ),
'type' => 'ct-color-palettes-picker', 'type' => 'ct-color-palettes-picker',
'design' => 'block', 'design' => 'block',
// translators: The interpolations addes a html link around the word. // translators: The interpolations addes a html link around the word.

View File

@ -14,7 +14,7 @@ if (! isset($enabled)) {
$options = [ $options = [
$prefix . 'display_filters_panel' => [ $prefix . 'display_filters_panel' => [
'label' => __( 'Filters panel', 'blocksy-tainacan' ), 'label' => __( 'Filters panel', 'tainacan-blocksy' ),
'type' => 'ct-panel', 'type' => 'ct-panel',
'switch' => true, 'switch' => true,
'value' => $enabled, 'value' => $enabled,
@ -37,7 +37,7 @@ $options = [
], ],
'options' => [ 'options' => [
$prefix . 'filters_panel_size' => [ $prefix . 'filters_panel_size' => [
'label' => __( 'Panel size', 'blocksy-tainacan' ), 'label' => __( 'Panel size', 'tainacan-blocksy' ),
'type' => 'ct-slider', 'type' => 'ct-slider',
'value' => '20%', 'value' => '20%',
'units' => blocksy_units_config([ 'units' => blocksy_units_config([
@ -53,17 +53,17 @@ $options = [
] ]
], ],
$prefix . 'start_with_filters_hidden' => [ $prefix . 'start_with_filters_hidden' => [
'label' => __( 'Start with filters hidden', 'blocksy-tainacan' ), 'label' => __( 'Start with filters hidden', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'desc' => __( 'Load page with filters panel initially hidden.', 'blocksy-tainacan' ), 'desc' => __( 'Load page with filters panel initially hidden.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
$prefix . 'show_hide_filters_button' => [ $prefix . 'show_hide_filters_button' => [
'label' => __( 'Show the "Hide filters" button', 'blocksy-tainacan' ), 'label' => __( 'Show the "Hide filters" button', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display the button for hidding the filters panel.', 'blocksy-tainacan' ), 'desc' => __( 'Display the button for hidding the filters panel.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
@ -73,27 +73,27 @@ $options = [
], ],
'options' => [ 'options' => [
$prefix . 'show_filters_button_inside_search_control' => [ $prefix . 'show_filters_button_inside_search_control' => [
'label' => __( 'Show filters button inside search control', 'blocksy-tainacan' ), 'label' => __( 'Show filters button inside search control', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display the filters button inside the search control bar instead of floating aside.', 'blocksy-tainacan' ), 'desc' => __( 'Display the filters button inside the search control bar instead of floating aside.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
], ],
], ],
$prefix . 'filters_fixed_on_scroll' => [ $prefix . 'filters_fixed_on_scroll' => [
'label' => __( 'Filters fixed on scroll', 'blocksy-tainacan' ), 'label' => __( 'Filters fixed on scroll', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'desc' => __( 'If you want filters panel to get fixed on screen when scrolling down the items list. This will only take effect if the items list itself is taller than the screen height.', 'blocksy-tainacan' ), 'desc' => __( 'If you want filters panel to get fixed on screen when scrolling down the items list. This will only take effect if the items list itself is taller than the screen height.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
$prefix . 'filters_as_modal' => [ $prefix . 'filters_as_modal' => [
'label' => __( 'Filters as modal', 'blocksy-tainacan' ), 'label' => __( 'Filters as modal', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'desc' => __( 'Display the filters panel as a full screen modal instead of aside, even on desktop.', 'blocksy-tainacan' ), 'desc' => __( 'Display the filters panel as a full screen modal instead of aside, even on desktop.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
] ]
], ],

View File

@ -43,14 +43,14 @@ $default_hero_elements[] = [
$options = [ $options = [
$prefix . 'page-header-panel' => [ $prefix . 'page-header-panel' => [
'label' => __( 'Page header', 'blocksy-tainacan' ), 'label' => __( 'Page header', 'tainacan-blocksy' ),
'type' => 'ct-panel', 'type' => 'ct-panel',
'sync' => blocksy_sync_whole_page([ 'sync' => blocksy_sync_whole_page([
'prefix' => $prefix, 'prefix' => $prefix,
]), ]),
'inner-options' => [ 'inner-options' => [
$prefix . 'page_header_background_style' => [ $prefix . 'page_header_background_style' => [
'label' => __('Header style', 'blocksy-tainacan'), 'label' => __('Header style', 'tainacan-blocksy'),
'type' => 'ct-radio', 'type' => 'ct-radio',
'value' => 'boxed', 'value' => 'boxed',
'view' => 'text', 'view' => 'text',

View File

@ -21,17 +21,17 @@ $options = [
'sync' => '', 'sync' => '',
'inner-options' => [ 'inner-options' => [
$prefix . 'show_items_per_page_button' => [ $prefix . 'show_items_per_page_button' => [
'label' => __( 'Show the "Items per page" button', 'blocksy-tainacan' ), 'label' => __( 'Show the "Items per page" button', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display the button for choosing how many items per page shoulb be loaded.', 'blocksy-tainacan' ), 'desc' => __( 'Display the button for choosing how many items per page shoulb be loaded.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
$prefix . 'show_go_to_page_button' => [ $prefix . 'show_go_to_page_button' => [
'label' => __( 'Show the "Go to page" button', 'blocksy-tainacan' ), 'label' => __( 'Show the "Go to page" button', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display the button for jumping to an specific page.', 'blocksy-tainacan' ), 'desc' => __( 'Display the button for jumping to an specific page.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
] ]
], ],

View File

@ -8,19 +8,19 @@ if (! isset($prefix)) {
$options = [ $options = [
$prefix . 'search-control-panel' => [ $prefix . 'search-control-panel' => [
'label' => __( 'Search control', 'blocksy-tainacan' ), 'label' => __( 'Search control', 'tainacan-blocksy' ),
'type' => 'ct-panel', 'type' => 'ct-panel',
'sync' => '', 'sync' => '',
'inner-options' => [ 'inner-options' => [
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-title', 'type' => 'ct-title',
'label' => __( 'Textual search', 'blocksy-tainacan' ), 'label' => __( 'Textual search', 'tainacan-blocksy' ),
], ],
$prefix . 'show_search' => [ $prefix . 'show_search' => [
'label' => __( 'Show simple search', 'blocksy-tainacan' ), 'label' => __( 'Show simple search', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display a simple textual search input for items title and description.', 'blocksy-tainacan' ), 'desc' => __( 'Display a simple textual search input for items title and description.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
@ -30,24 +30,24 @@ $options = [
], ],
'options' => [ 'options' => [
$prefix . 'show_advanced_search' => [ $prefix . 'show_advanced_search' => [
'label' => __( 'Show advanced search', 'blocksy-tainacan' ), 'label' => __( 'Show advanced search', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display a link to open the advanced search panel.', 'blocksy-tainacan' ), 'desc' => __( 'Display a link to open the advanced search panel.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
], ],
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-title', 'type' => 'ct-title',
'label' => __( 'Sorting', 'blocksy-tainacan' ), 'label' => __( 'Sorting', 'tainacan-blocksy' ),
], ],
$prefix . 'show_sorting_area' => [ $prefix . 'show_sorting_area' => [
'label' => __( 'Show sorting options', 'blocksy-tainacan' ), 'label' => __( 'Show sorting options', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display options related to the search such as the "Sort by" button and "Sort direction"', 'blocksy-tainacan' ), 'desc' => __( 'Display options related to the search such as the "Sort by" button and "Sort direction"', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
@ -57,49 +57,49 @@ $options = [
], ],
'options' => [ 'options' => [
$prefix . 'show_sort_by_button' => [ $prefix . 'show_sort_by_button' => [
'label' => __( 'Show "Sort by" button', 'blocksy-tainacan' ), 'label' => __( 'Show "Sort by" button', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display the "Sort by" button, to select a metadata to sort by.', 'blocksy-tainacan' ), 'desc' => __( 'Display the "Sort by" button, to select a metadata to sort by.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
], ],
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-title', 'type' => 'ct-title',
'label' => __( 'View modes', 'blocksy-tainacan' ), 'label' => __( 'View modes', 'tainacan-blocksy' ),
], ],
$prefix . 'show_inline_view_mode_options' => [ $prefix . 'show_inline_view_mode_options' => [
'label' => __( 'Show inline view mode options', 'blocksy-tainacan' ), 'label' => __( 'Show inline view mode options', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'desc' => __( 'Display view mode options as inline buttons instead of a dropdown.', 'blocksy-tainacan' ), 'desc' => __( 'Display view mode options as inline buttons instead of a dropdown.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
$prefix . 'show_fullscreen_with_view_modes' => [ $prefix . 'show_fullscreen_with_view_modes' => [
'label' => __( 'Show full screen with view modes', 'blocksy-tainacan' ), 'label' => __( 'Show full screen with view modes', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'desc' => __( 'Offers full screen view mode options alongside other view modes instead of separated in the search control bar.', 'blocksy-tainacan' ), 'desc' => __( 'Offers full screen view mode options alongside other view modes instead of separated in the search control bar.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
$prefix . 'show_displayed_metadata_dropdown' => [ $prefix . 'show_displayed_metadata_dropdown' => [
'label' => __( 'Show "Displayed metadata" dropdown', 'blocksy-tainacan' ), 'label' => __( 'Show "Displayed metadata" dropdown', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display a dropdown for selecting the displayed metadata. This option may or not be present according to the current selected view mode.', 'blocksy-tainacan' ), 'desc' => __( 'Display a dropdown for selecting the displayed metadata. This option may or not be present according to the current selected view mode.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-title', 'type' => 'ct-title',
'label' => __( 'Exposers', 'blocksy-tainacan' ), 'label' => __( 'Exposers', 'tainacan-blocksy' ),
], ],
$prefix . 'show_exposers_button' => [ $prefix . 'show_exposers_button' => [
'label' => __( 'Show "View as..." button', 'blocksy-tainacan' ), 'label' => __( 'Show "View as..." button', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'desc' => __( 'Display the "View as..." button, which opens the exposers modal.', 'blocksy-tainacan' ), 'desc' => __( 'Display the "View as..." button, which opens the exposers modal.', 'tainacan-blocksy' ),
'sync' => '' 'sync' => ''
], ],
], ],

View File

@ -7,7 +7,7 @@ $options = [
'tainacan_repository_items_list_section_options' => [ 'tainacan_repository_items_list_section_options' => [
'type' => 'ct-options', 'type' => 'ct-options',
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'inner-options' => blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/posts/tainacan-item-archive.php', [ 'inner-options' => blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/posts/tainacan-item-archive.php', [
'prefix' => 'tainacan-repository-items', 'prefix' => 'tainacan-repository-items',
'is_general_cpt' => true 'is_general_cpt' => true
], false), ], false),

View File

@ -8,7 +8,7 @@ $options = [
'tainacan_terms_items_list_section_options' => [ 'tainacan_terms_items_list_section_options' => [
'type' => 'ct-options', 'type' => 'ct-options',
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'inner-options' => blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/posts/tainacan-item-archive.php', [ 'inner-options' => blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/posts/tainacan-item-archive.php', [
'prefix' => 'tainacan-terms-items', 'prefix' => 'tainacan-terms-items',
'is_general_cpt' => true 'is_general_cpt' => true
], false), ], false),

View File

@ -8,25 +8,25 @@ $options = [
], ],
], ],
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/archive-elements/page-header.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/archive-elements/page-header.php', [
'prefix' => $prefix . '_archive' 'prefix' => $prefix . '_archive'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/archive-elements/search-control.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/archive-elements/search-control.php', [
'prefix' => $prefix . '_archive' 'prefix' => $prefix . '_archive'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/archive-elements/filters-panel.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/archive-elements/filters-panel.php', [
'prefix' => $prefix . '_archive', 'prefix' => $prefix . '_archive',
'enabled' => 'yes' 'enabled' => 'yes'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/archive-elements/pagination.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/archive-elements/pagination.php', [
'prefix' => $prefix . '_archive', 'prefix' => $prefix . '_archive',
'enabled' => 'yes' 'enabled' => 'yes'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/archive-elements/color-palettes.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/archive-elements/color-palettes.php', [
'prefix' => $prefix . '_archive' 'prefix' => $prefix . '_archive'
], false), ], false),
]; ];

View File

@ -12,21 +12,21 @@ $options = [
[ [
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-title', 'type' => 'ct-title',
'label' => __( 'Tainacan Item Elements', 'blocksy-tainacan' ), 'label' => __( 'Tainacan Item Elements', 'tainacan-blocksy' ),
], ],
], ],
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/tainacan-single-structure.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/tainacan-single-structure.php', [
'prefix' => $post_type->name . '_single', 'prefix' => $post_type->name . '_single',
'location' => 'teste' 'location' => 'teste'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/section-labels.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/section-labels.php', [
'prefix' => $post_type->name . '_single', 'prefix' => $post_type->name . '_single',
'enabled' => 'yes' 'enabled' => 'yes'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/document-attachments.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/document-attachments.php', [
'prefix' => $post_type->name . '_single', 'prefix' => $post_type->name . '_single',
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-list.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-list.php', [
'prefix' => $post_type->name . '_single', 'prefix' => $post_type->name . '_single',
], false) ], false)
]; ];

View File

@ -6,7 +6,7 @@ if (! isset($prefix)) {
$options = [ $options = [
$prefix . 'attachments_size' => [ $prefix . 'attachments_size' => [
'label' => __( 'Attachments size on carousel', 'blocksy-tainacan' ), 'label' => __( 'Attachments size on carousel', 'tainacan-blocksy' ),
'type' => 'ct-slider', 'type' => 'ct-slider',
'value' => [ 'value' => [
'mobile' => '120px', 'mobile' => '120px',

View File

@ -7,7 +7,7 @@ if (! isset($prefix)) {
$options = [ $options = [
$prefix . 'attachments_label_font' => [ $prefix . 'attachments_label_font' => [
'type' => 'ct-typography', 'type' => 'ct-typography',
'label' => __( 'Attachments label on carousel', 'blocksy-tainacan' ), 'label' => __( 'Attachments label on carousel', 'tainacan-blocksy' ),
'value' => blocksy_typography_default_values([ 'value' => blocksy_typography_default_values([
'size' => '0.875rem', 'size' => '0.875rem',
'line-height' => '1.5' 'line-height' => '1.5'

View File

@ -12,8 +12,8 @@ $options = [
], ],
'options' => [ 'options' => [
$prefix . 'document_attachments_columns' => [ $prefix . 'document_attachments_columns' => [
'label' => __( 'Document and Attachments columns width', 'blocksy-tainacan' ), 'label' => __( 'Document and Attachments columns width', 'tainacan-blocksy' ),
'desc' => __( 'This option is only available when using two columns layout', 'blocksy-tainacan'), 'desc' => __( 'This option is only available when using two columns layout', 'tainacan-blocksy'),
'type' => 'ct-slider', 'type' => 'ct-slider',
'value' => '60%', 'value' => '60%',
'units' => blocksy_units_config([ 'units' => blocksy_units_config([

View File

@ -16,12 +16,12 @@ $options = [
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'choices' => [ 'choices' => [
'gallery-type-1' => [ 'gallery-type-1' => [
'src' => blocksy_tainacan_image_picker_url( 'gallery-type-1.svg' ), 'src' => tainacan_blocksy_image_picker_url( 'gallery-type-1.svg' ),
'title' => __( 'Document and Attachments separate', 'blocksy-tainacan' ), 'title' => __( 'Document and Attachments separate', 'tainacan-blocksy' ),
], ],
'gallery-type-2' => [ 'gallery-type-2' => [
'src' => blocksy_tainacan_image_picker_url( 'gallery-type-2.svg' ), 'src' => tainacan_blocksy_image_picker_url( 'gallery-type-2.svg' ),
'title' => __( 'Document and Attachments merged', 'blocksy-tainacan' ), 'title' => __( 'Document and Attachments merged', 'tainacan-blocksy' ),
], ],
], ],
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([

View File

@ -8,7 +8,7 @@ if (! isset($prefix)) {
$options = [ $options = [
$prefix . 'document-attachments' => [ $prefix . 'document-attachments' => [
'label' => __( 'Document and attachments', 'blocksy-tainacan' ), 'label' => __( 'Document and attachments', 'tainacan-blocksy' ),
'type' => 'ct-panel', 'type' => 'ct-panel',
'sync' => blocksy_sync_whole_page([ 'sync' => blocksy_sync_whole_page([
'prefix' => $prefix, 'prefix' => $prefix,
@ -19,30 +19,30 @@ $options = [
'title' => __( 'General', 'blocksy' ), 'title' => __( 'General', 'blocksy' ),
'type' => 'tab', 'type' => 'tab',
'options' => [ 'options' => [
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/document-attachments-structure.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/document-attachments-structure.php', [
'prefix' => $prefix, 'prefix' => $prefix,
'enabled' => 'no' 'enabled' => 'no'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/document-attachments-columns.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/document-attachments-columns.php', [
'prefix' => $prefix 'prefix' => $prefix
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-download-button.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-download-button.php', [
'prefix' => $prefix, 'prefix' => $prefix,
'enabled' => 'no' 'enabled' => 'no'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-files-name.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-files-name.php', [
'prefix' => $prefix, 'prefix' => $prefix,
'enabled' => 'no' 'enabled' => 'no'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-files-caption-main.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-files-caption-main.php', [
'prefix' => $prefix, 'prefix' => $prefix,
'enabled' => 'yes' 'enabled' => 'yes'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-files-name-main.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-files-name-main.php', [
'prefix' => $prefix, 'prefix' => $prefix,
'enabled' => 'yes' 'enabled' => 'yes'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-files-description-main.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-files-description-main.php', [
'prefix' => $prefix, 'prefix' => $prefix,
'enabled' => 'yes' 'enabled' => 'yes'
], false) ], false)
@ -53,10 +53,10 @@ $options = [
'title' => __( 'Design', 'blocksy' ), 'title' => __( 'Design', 'blocksy' ),
'type' => 'tab', 'type' => 'tab',
'options' => [ 'options' => [
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/attachments-typography.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/attachments-typography.php', [
'prefix' => $prefix 'prefix' => $prefix
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/attachments-size.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/attachments-size.php', [
'prefix' => $prefix 'prefix' => $prefix
], false) ], false)
], ],

View File

@ -9,11 +9,11 @@ if (! isset($enabled)) {
$options = [ $options = [
$prefix . 'hide_download_button' => [ $prefix . 'hide_download_button' => [
'label' => __( 'Hide document download button', 'blocksy-tainacan' ), 'label' => __( 'Hide document download button', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => $enabled, 'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Toggle to never display a "Download" button when hovering the document.', 'blocksy-tainacan' ), 'desc' => __( 'Toggle to never display a "Download" button when hovering the document.', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix, 'prefix' => $prefix,
]), ]),

View File

@ -9,11 +9,11 @@ if (! isset($enabled)) {
$options = [ $options = [
$prefix . 'hide_files_caption_main' => [ $prefix . 'hide_files_caption_main' => [
'label' => __( 'Hide files caption', 'blocksy-tainacan' ), 'label' => __( 'Hide files caption', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => $enabled, 'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Toggle to hide the attachments and document caption on the main view.', 'blocksy-tainacan' ), 'desc' => __( 'Toggle to hide the attachments and document caption on the main view.', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix, 'prefix' => $prefix,
]), ]),

View File

@ -9,11 +9,11 @@ if (! isset($enabled)) {
$options = [ $options = [
$prefix . 'hide_files_description_main' => [ $prefix . 'hide_files_description_main' => [
'label' => __( 'Hide files description', 'blocksy-tainacan' ), 'label' => __( 'Hide files description', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => $enabled, 'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Toggle to hide the attachments and document description on the main view.', 'blocksy-tainacan' ), 'desc' => __( 'Toggle to hide the attachments and document description on the main view.', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix, 'prefix' => $prefix,
]), ]),

View File

@ -9,11 +9,11 @@ if (! isset($enabled)) {
$options = [ $options = [
$prefix . 'hide_files_name_main' => [ $prefix . 'hide_files_name_main' => [
'label' => __( 'Hide files name', 'blocksy-tainacan' ), 'label' => __( 'Hide files name', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => $enabled, 'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Toggle to hide the attachments and document name on the main view.', 'blocksy-tainacan' ), 'desc' => __( 'Toggle to hide the attachments and document name on the main view.', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix, 'prefix' => $prefix,
]), ]),

View File

@ -9,11 +9,11 @@ if (! isset($enabled)) {
$options = [ $options = [
$prefix . 'hide_files_name' => [ $prefix . 'hide_files_name' => [
'label' => __( 'Hide files name on carousel', 'blocksy-tainacan' ), 'label' => __( 'Hide files name on carousel', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => $enabled, 'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Toggle to hide the attachments and document name on the carousel.', 'blocksy-tainacan' ), 'desc' => __( 'Toggle to hide the attachments and document name on the carousel.', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix, 'prefix' => $prefix,
]), ]),

View File

@ -6,7 +6,7 @@ if (! isset($prefix)) {
$options = [ $options = [
$prefix . 'tainacan_metadata_columns' => [ $prefix . 'tainacan_metadata_columns' => [
'label' => __( 'Metadata columns width', 'blocksy-tainacan' ), 'label' => __( 'Metadata columns width', 'tainacan-blocksy' ),
'type' => 'ct-slider', 'type' => 'ct-slider',
'value' => [ 'value' => [
'mobile' => '200px', 'mobile' => '200px',

View File

@ -8,12 +8,12 @@ $options = [
[ [
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-title', 'type' => 'ct-title',
'label' => __( 'Metadata Label', 'blocksy-tainacan' ), 'label' => __( 'Metadata Label', 'tainacan-blocksy' ),
], ],
], ],
$prefix . 'tainacan_metadata_label_font' => [ $prefix . 'tainacan_metadata_label_font' => [
'type' => 'ct-typography', 'type' => 'ct-typography',
'label' => __( 'Font settings', 'blocksy-tainacan' ), 'label' => __( 'Font settings', 'tainacan-blocksy' ),
'value' => blocksy_typography_default_values([ 'value' => blocksy_typography_default_values([
'size' => '20px', 'size' => '20px',
'variation' => 'n6', 'variation' => 'n6',

View File

@ -13,13 +13,13 @@ $options = [
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'choices' => [ 'choices' => [
'metadata-type-1' => [ 'metadata-type-1' => [
'src' => blocksy_tainacan_image_picker_url( 'metadata-type-1.svg' ), 'src' => tainacan_blocksy_image_picker_url( 'metadata-type-1.svg' ),
'title' => __( 'Label above values', 'blocksy-tainacan' ), 'title' => __( 'Label above values', 'tainacan-blocksy' ),
], ],
'metadata-type-2' => [ 'metadata-type-2' => [
'src' => blocksy_tainacan_image_picker_url( 'metadata-type-2.svg' ), 'src' => tainacan_blocksy_image_picker_url( 'metadata-type-2.svg' ),
'title' => __( 'Label aside values', 'blocksy-tainacan' ), 'title' => __( 'Label aside values', 'tainacan-blocksy' ),
], ],
], ],
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([

View File

@ -8,7 +8,7 @@ if (! isset($prefix)) {
$options = [ $options = [
$prefix . 'metadata-list' => [ $prefix . 'metadata-list' => [
'label' => __( 'Item metadata list', 'blocksy-tainacan' ), 'label' => __( 'Item metadata list', 'tainacan-blocksy' ),
'type' => 'ct-panel', 'type' => 'ct-panel',
'sync' => blocksy_sync_whole_page([ 'sync' => blocksy_sync_whole_page([
'prefix' => $prefix, 'prefix' => $prefix,
@ -19,17 +19,17 @@ $options = [
'title' => __( 'General', 'blocksy' ), 'title' => __( 'General', 'blocksy' ),
'type' => 'tab', 'type' => 'tab',
'options' => [ 'options' => [
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-list-structure.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-list-structure.php', [
'prefix' => $prefix 'prefix' => $prefix
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-columns.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-columns.php', [
'prefix' => $prefix 'prefix' => $prefix
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/show-title-metadata.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/show-title-metadata.php', [
'prefix' => $prefix, 'prefix' => $prefix,
'enabled' => 'yes' 'enabled' => 'yes'
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/show-thumbnail.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/show-thumbnail.php', [
'prefix' => $prefix, 'prefix' => $prefix,
'enabled' => 'no' 'enabled' => 'no'
], false), ], false),
@ -40,10 +40,10 @@ $options = [
'title' => __( 'Design', 'blocksy' ), 'title' => __( 'Design', 'blocksy' ),
'type' => 'tab', 'type' => 'tab',
'options' => [ 'options' => [
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-labels.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-labels.php', [
'prefix' => $prefix 'prefix' => $prefix
], false), ], false),
blocksy_get_options(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-values.php', [ blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/metadata-values.php', [
'prefix' => $prefix 'prefix' => $prefix
], false) ], false)
], ],

View File

@ -8,12 +8,12 @@ $options = [
[ [
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-title', 'type' => 'ct-title',
'label' => __( 'Metadata Value', 'blocksy-tainacan' ), 'label' => __( 'Metadata Value', 'tainacan-blocksy' ),
], ],
], ],
$prefix . 'tainacan_metadata_value_font' => [ $prefix . 'tainacan_metadata_value_font' => [
'type' => 'ct-typography', 'type' => 'ct-typography',
'label' => __( 'Font settings', 'blocksy-tainacan' ), 'label' => __( 'Font settings', 'tainacan-blocksy' ),
'value' => blocksy_typography_default_values([ 'value' => blocksy_typography_default_values([
'size' => '17px' 'size' => '17px'
]), ]),

View File

@ -12,7 +12,7 @@ if (! isset($enabled)) {
$options = [ $options = [
$prefix . 'display_section_labels' => [ $prefix . 'display_section_labels' => [
'label' => __( 'Display section labels', 'blocksy-tainacan' ), 'label' => __( 'Display section labels', 'tainacan-blocksy' ),
'type' => 'ct-panel', 'type' => 'ct-panel',
'switch' => true, 'switch' => true,
'value' => $enabled, 'value' => $enabled,
@ -57,21 +57,21 @@ $options = [
], ],
'options' => [ 'options' => [
$prefix . 'section_document_label' => [ $prefix . 'section_document_label' => [
'label' => __( 'Label for the "Document" section', 'blocksy-tainacan' ), 'label' => __( 'Label for the "Document" section', 'tainacan-blocksy' ),
'desc' => __( 'Leave it blank for not displaying any label.', 'blocksy-tainacan' ), 'desc' => __( 'Leave it blank for not displaying any label.', 'tainacan-blocksy' ),
'type' => 'text', 'type' => 'text',
'design' => 'block', 'design' => 'block',
'value' => __( 'Document', 'blocksy-tainacan' ), 'value' => __( 'Document', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix 'prefix' => $prefix
]) ])
], ],
$prefix . 'section_attachments_label' => [ $prefix . 'section_attachments_label' => [
'label' => __( 'Label for the "Attachments" section', 'blocksy-tainacan' ), 'label' => __( 'Label for the "Attachments" section', 'tainacan-blocksy' ),
'desc' => __( 'Leave it blank for not displaying any label.', 'blocksy-tainacan' ), 'desc' => __( 'Leave it blank for not displaying any label.', 'tainacan-blocksy' ),
'type' => 'text', 'type' => 'text',
'design' => 'block', 'design' => 'block',
'value' => __( 'Attachments', 'blocksy-tainacan' ), 'value' => __( 'Attachments', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix 'prefix' => $prefix
]) ])
@ -85,11 +85,11 @@ $options = [
], ],
'options' => [ 'options' => [
$prefix . 'section_documents_label' => [ $prefix . 'section_documents_label' => [
'label' => __( 'Label for the "Documents" section', 'blocksy-tainacan' ), 'label' => __( 'Label for the "Documents" section', 'tainacan-blocksy' ),
'desc' => __( 'Leave it blank for not displaying any label. This section is displayed only if Documents and Attachments are displayed merged.', 'blocksy-tainacan' ), 'desc' => __( 'Leave it blank for not displaying any label. This section is displayed only if Documents and Attachments are displayed merged.', 'tainacan-blocksy' ),
'type' => 'text', 'type' => 'text',
'design' => 'block', 'design' => 'block',
'value' => __( 'Documents', 'blocksy-tainacan' ), 'value' => __( 'Documents', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix 'prefix' => $prefix
]) ])
@ -97,11 +97,11 @@ $options = [
] ]
], ],
$prefix . 'section_metadata_label' => [ $prefix . 'section_metadata_label' => [
'label' => __( 'Label for the "Metadata" section', 'blocksy-tainacan' ), 'label' => __( 'Label for the "Metadata" section', 'tainacan-blocksy' ),
'desc' => __( 'Leave it blank for not displaying any label.', 'blocksy-tainacan' ), 'desc' => __( 'Leave it blank for not displaying any label.', 'tainacan-blocksy' ),
'type' => 'text', 'type' => 'text',
'design' => 'block', 'design' => 'block',
'value' => __( 'Metadata', 'blocksy-tainacan' ), 'value' => __( 'Metadata', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix 'prefix' => $prefix
]) ])

View File

@ -9,11 +9,11 @@ if (! isset($enabled)) {
$options = [ $options = [
$prefix . 'show_thumbnail' => [ $prefix . 'show_thumbnail' => [
'label' => __( 'Item thumbnail in the metadata list', 'blocksy-tainacan' ), 'label' => __( 'Item thumbnail in the metadata list', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => $enabled, 'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ], 'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Toggle to show or not the item thumbnail on the metadada list.', 'blocksy-tainacan' ), 'desc' => __( 'Toggle to show or not the item thumbnail on the metadada list.', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix 'prefix' => $prefix
]) ])

View File

@ -10,11 +10,11 @@ if (! isset($enabled)) {
$options = [ $options = [
$prefix . 'show_title_metadata' => [ $prefix . 'show_title_metadata' => [
'label' => __( 'Core title in the metadata list', 'blocksy-tainacan' ), 'label' => __( 'Core title in the metadata list', 'tainacan-blocksy' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => $enabled, 'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ], '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-tainacan' ), 'desc' => __( 'Toggle to hide or not the core title from the metadada list, as it already appears on the page title.', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([ 'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix 'prefix' => $prefix
]) ])

View File

@ -0,0 +1,46 @@
<?php
if (! isset($prefix)) {
$prefix = '';
} else {
$prefix = $prefix . '_';
}
$options = [
$prefix . 'page_structure_type' => [
'label' => false,
'type' => 'ct-image-picker',
'value' => 'type-dam',
'design' => 'block',
'setting' => [ 'transport' => 'postMessage' ],
'choices' => [
'type-dam' => [
'src' => tainacan_blocksy_image_picker_url( 'type-dam.svg' ),
'title' => __( 'Document, Attachments, Metadata', 'tainacan-blocksy' ),
],
'type-dma' => [
'src' => tainacan_blocksy_image_picker_url( 'type-dma.svg' ),
'title' => __( 'Document, Metadata, Attachments', 'tainacan-blocksy' ),
],
'type-mda' => [
'src' => tainacan_blocksy_image_picker_url( 'type-mda.svg' ),
'title' => __( 'Metadata, Document, Attachments', 'tainacan-blocksy' ),
],
'type-gm' => [
'src' => tainacan_blocksy_image_picker_url( 'type-gm.svg' ),
'title' => __( 'Metadata to the right', 'tainacan-blocksy' ),
],
'type-mg' => [
'src' => tainacan_blocksy_image_picker_url( 'type-mg.svg' ),
'title' => __( 'Metadata to the left', 'tainacan-blocksy' ),
],
],
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix
])
],
];

View File

@ -4,8 +4,8 @@
* Uses Template redirect for setting the proper template to items * Uses Template redirect for setting the proper template to items
* archives on Tainacan pages * archives on Tainacan pages
*/ */
if ( !function_exists('blocksy_tainacan_archive_templates_redirects') ) { if ( !function_exists('tainacan_blocksy_archive_templates_redirects') ) {
function blocksy_tainacan_archive_templates_redirects() { function tainacan_blocksy_archive_templates_redirects() {
global $wp_query; global $wp_query;
if (is_post_type_archive()) { if (is_post_type_archive()) {
@ -15,7 +15,7 @@ if ( !function_exists('blocksy_tainacan_archive_templates_redirects') ) {
if (in_array($current_post_type, $collections_post_types)) { if (in_array($current_post_type, $collections_post_types)) {
if (is_post_type_archive()) { if (is_post_type_archive()) {
include( BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/tainacan/archive-items.php' ); include( TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/tainacan/archive-items.php' );
exit; exit;
} }
} }
@ -26,28 +26,28 @@ if ( !function_exists('blocksy_tainacan_archive_templates_redirects') ) {
$tax_id = \Tainacan\Repositories\Taxonomies::get_instance()->get_id_by_db_identifier($term->taxonomy); $tax_id = \Tainacan\Repositories\Taxonomies::get_instance()->get_id_by_db_identifier($term->taxonomy);
$tax = \Tainacan\Repositories\Taxonomies::get_instance()->fetch($tax_id); $tax = \Tainacan\Repositories\Taxonomies::get_instance()->fetch($tax_id);
include( BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/tainacan/archive-taxonomy.php' ); include( TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/tainacan/archive-taxonomy.php' );
exit; exit;
} }
} else if ( $wp_query->get( 'tainacan_repository_archive' ) == 1 ) { } else if ( $wp_query->get( 'tainacan_repository_archive' ) == 1 ) {
include( BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/tainacan/archive-items.php' ); include( TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/tainacan/archive-items.php' );
exit; exit;
} }
} }
} }
add_action('template_redirect', 'blocksy_tainacan_archive_templates_redirects'); add_action('template_redirect', 'tainacan_blocksy_archive_templates_redirects');
/** /**
* Uses Template redirect for setting the proper template to items * Uses Template redirect for setting the proper template to items
* archives on Tainacan pages * archives on Tainacan pages
*/ */
if ( !function_exists('blocksy_tainacan_update_extensions_paths') ) { if ( !function_exists('tainacan_blocksy_update_extensions_paths') ) {
function blocksy_tainacan_update_extensions_paths($paths) { function tainacan_blocksy_update_extensions_paths($paths) {
return $paths; return $paths;
} }
} }
add_filter( 'blocksy_extensions_paths', 'blocksy_tainacan_update_extensions_paths'); add_filter( 'blocksy_extensions_paths', 'tainacan_blocksy_update_extensions_paths');
?> ?>

View File

@ -1,6 +1,6 @@
{ {
"name": "blocksy-tainacan", "name": "tainacan-blocksy",
"version": "0.1.2", "version": "0.1.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "blocksy-tainacan", "name": "tainacan-blocksy",
"version": "0.1.2", "version": "0.1.3",
"description": "A Blocksy plugin/child theme compatible with Tainacan", "description": "A Blocksy plugin/child theme compatible with Tainacan",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -1,9 +1,9 @@
/** /**
* Theme Name: Blocksy Tainacan * Theme Name: Tainacan Support for Blocksy
* Description: A Blocksy plugin/child theme compatible with Tainacan plugin * Description: A Tainacan plugin/child theme compatible with Blocksy theme
* Author: Tainacan * Author: Tainacan
* Template: blocksy * Template: blocksy
* Text Domain: blocksy-tainacan * Text Domain: tainacan-blocksy
*/ */
/* Tainacan Gutenberg Blocks colors */ /* Tainacan Gutenberg Blocks colors */

View File

Before

Width:  |  Height:  |  Size: 449 KiB

After

Width:  |  Height:  |  Size: 449 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,9 +1,9 @@
/** /**
* Theme Name: Blocksy Tainacan * Theme Name: Tainacan Support for Blocksy
* Description: A Blocksy plugin/child theme compatible with Tainacan plugin * Description: A Tainacan plugin/child theme compatible with Blocksy theme
* Author: Tainacan * Author: Tainacan
* Template: blocksy * Template: blocksy
* Text Domain: blocksy-tainacan * Text Domain: tainacan-blocksy
*/ */
/* Tainacan Gutenberg Blocks colors */ /* Tainacan Gutenberg Blocks colors */
:root { :root {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,9 +9,9 @@
$prefix = blocksy_manager()->screen->get_prefix(); $prefix = blocksy_manager()->screen->get_prefix();
do_action( 'blocksy-tainacan-single-item-top' ); do_action( 'tainacan-blocksy-single-item-top' );
do_action( 'blocksy-tainacan-single-item-after-title' ); do_action( 'tainacan-blocksy-single-item-after-title' );
$page_structure_type = get_theme_mod( $prefix . '_page_structure_type', 'type-dam'); $page_structure_type = get_theme_mod( $prefix . '_page_structure_type', 'type-dam');
$template_columns_style = ''; $template_columns_style = '';
@ -33,14 +33,14 @@ if ($page_structure_type == 'type-gm' || $page_structure_type == 'type-mg') {
<div class="<?php echo 'tainacan-item-single tainacan-item-single--layout-'. $page_structure_type ?>" style="<?php echo $template_columns_style ?>"> <div class="<?php echo 'tainacan-item-single tainacan-item-single--layout-'. $page_structure_type ?>" style="<?php echo $template_columns_style ?>">
<?php <?php
blocksy_tainacan_get_template_part( 'template-parts/tainacan-item-single-document' ); tainacan_blocksy_get_template_part( 'template-parts/tainacan-item-single-document' );
do_action( 'blocksy-tainacan-single-item-after-document' ); do_action( 'tainacan-blocksy-single-item-after-document' );
blocksy_tainacan_get_template_part( 'template-parts/tainacan-item-single-attachments' ); tainacan_blocksy_get_template_part( 'template-parts/tainacan-item-single-attachments' );
do_action( 'blocksy-tainacan-single-item-after-attachments' ); do_action( 'tainacan-blocksy-single-item-after-attachments' );
blocksy_tainacan_get_template_part( 'template-parts/tainacan-item-single-metadata' ); tainacan_blocksy_get_template_part( 'template-parts/tainacan-item-single-metadata' );
do_action( 'blocksy-tainacan-single-item-after-metadata' ); do_action( 'tainacan-blocksy-single-item-after-metadata' );
?> ?>
</div> </div>
@ -55,4 +55,4 @@ if ($page_structure_type == 'type-gm' || $page_structure_type == 'type-mg') {
?> ?>
</div> </div>
<?php do_action( 'blocksy-tainacan-single-item-bottom' ); ?> <?php do_action( 'tainacan-blocksy-single-item-bottom' ); ?>

View File

@ -15,14 +15,14 @@
if ( function_exists('tainacan_the_media_component') && ( !empty( $attachments ) || ( $is_gallery_mode && tainacan_has_document() ) ) ) { if ( function_exists('tainacan_the_media_component') && ( !empty( $attachments ) || ( $is_gallery_mode && tainacan_has_document() ) ) ) {
?> ?>
<section class="tainacan-item-section tainacan-item-section--<?php echo ((!$is_gallery_mode ? 'attachments' : 'gallery')) ?>"> <section class="tainacan-item-section tainacan-item-section--<?php echo ((!$is_gallery_mode ? 'attachments' : 'gallery')) ?>">
<?php if ( (get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes') && (!$is_gallery_mode) && get_theme_mod($prefix . '_section_attachments_label', __( 'Attachments', 'blocksy-tainacan' )) != '' ) : ?> <?php if ( (get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes') && (!$is_gallery_mode) && get_theme_mod($prefix . '_section_attachments_label', __( 'Attachments', 'tainacan-blocksy' )) != '' ) : ?>
<h2 class="tainacan-single-item-section" id="tainacan-item-attachments-label"> <h2 class="tainacan-single-item-section" id="tainacan-item-attachments-label">
<?php echo esc_html( get_theme_mod($prefix . '_section_attachments_label', __( 'Attachments', 'blocksy-tainacan' ) ) ); ?> <?php echo esc_html( get_theme_mod($prefix . '_section_attachments_label', __( 'Attachments', 'tainacan-blocksy' ) ) ); ?>
</h2> </h2>
<?php endif; ?> <?php endif; ?>
<?php if ( (get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes') && ($is_gallery_mode) && get_theme_mod($prefix . '_section_documents_label', __( 'Documents', 'blocksy-tainacan' )) != '') : ?> <?php if ( (get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes') && ($is_gallery_mode) && get_theme_mod($prefix . '_section_documents_label', __( 'Documents', 'tainacan-blocksy' )) != '') : ?>
<h2 class="tainacan-single-item-section" id="tainacan-item-documents-label"> <h2 class="tainacan-single-item-section" id="tainacan-item-documents-label">
<?php echo esc_html( get_theme_mod($prefix . '_section_documents_label', __( 'Documents', 'blocksy-tainacan' )) ); ?> <?php echo esc_html( get_theme_mod($prefix . '_section_documents_label', __( 'Documents', 'tainacan-blocksy' )) ); ?>
</h2> </h2>
<?php endif; ?> <?php endif; ?>

View File

@ -9,9 +9,9 @@
?> ?>
<?php if ( tainacan_has_document() && !$is_gallery_mode ) : ?> <?php if ( tainacan_has_document() && !$is_gallery_mode ) : ?>
<section class="tainacan-item-section tainacan-item-section--document"> <section class="tainacan-item-section tainacan-item-section--document">
<?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && get_theme_mod($prefix . '_section_document_label', __( 'Document', 'blocksy-tainacan' )) != '' ) : ?> <?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && get_theme_mod($prefix . '_section_document_label', __( 'Document', 'tainacan-blocksy' )) != '' ) : ?>
<h2 class="tainacan-single-item-section" id="tainacan-item-document-label"> <h2 class="tainacan-single-item-section" id="tainacan-item-document-label">
<?php echo esc_html( get_theme_mod($prefix . '_section_document_label', __( 'Document', 'blocksy-tainacan' ) ) ); ?> <?php echo esc_html( get_theme_mod($prefix . '_section_document_label', __( 'Document', 'tainacan-blocksy' ) ) ); ?>
</h2> </h2>
<?php endif; ?> <?php endif; ?>
<div class="tainacan-item-section__document"> <div class="tainacan-item-section__document">

View File

@ -3,19 +3,19 @@
?> ?>
<section class="tainacan-item-section tainacan-item-section--metadata"> <section class="tainacan-item-section tainacan-item-section--metadata">
<?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && get_theme_mod($prefix . '_section_metadata_label', __( 'Metadata', 'blocksy-tainacan' )) != '' ) : ?> <?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && get_theme_mod($prefix . '_section_metadata_label', __( 'Metadata', 'tainacan-blocksy' )) != '' ) : ?>
<h2 class="tainacan-single-item-section" id="tainacan-item-metadata-label"> <h2 class="tainacan-single-item-section" id="tainacan-item-metadata-label">
<?php echo esc_html( get_theme_mod($prefix . '_section_metadata_label', __( 'Metadata', 'blocksy-tainacan' ) ) ); ?> <?php echo esc_html( get_theme_mod($prefix . '_section_metadata_label', __( 'Metadata', 'tainacan-blocksy' ) ) ); ?>
</h2> </h2>
<?php endif; ?> <?php endif; ?>
<div class="tainacan-item-section__metadata <?php echo get_theme_mod($prefix . '_metadata_list_structure_type', 'metadata-type-1') ?>"> <div class="tainacan-item-section__metadata <?php echo get_theme_mod($prefix . '_metadata_list_structure_type', 'metadata-type-1') ?>">
<?php if (has_post_thumbnail() && (get_theme_mod($prefix . '_show_thumbnail', 'no') === 'yes') ): ?> <?php if (has_post_thumbnail() && (get_theme_mod($prefix . '_show_thumbnail', 'no') === 'yes') ): ?>
<div class="tainacan-item-section__metadata-thumbnail"> <div class="tainacan-item-section__metadata-thumbnail">
<h3 class="tainacan-metadata-label"><?php _e( 'Thumbnail', 'blocksy-tainacan' ); ?></h3> <h3 class="tainacan-metadata-label"><?php _e( 'Thumbnail', 'tainacan-blocksy' ); ?></h3>
<p class="tainacan-metadata-value"><?php the_post_thumbnail('tainacan-medium-full'); ?></p> <p class="tainacan-metadata-value"><?php the_post_thumbnail('tainacan-medium-full'); ?></p>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php do_action( 'blocksy-tainacan-single-item-metadata-begin' ); ?> <?php do_action( 'tainacan-blocksy-single-item-metadata-begin' ); ?>
<?php <?php
$args = array( $args = array(
'display_slug_as_class' => true, 'display_slug_as_class' => true,
@ -27,6 +27,6 @@
); );
tainacan_the_metadata( $args ); tainacan_the_metadata( $args );
?> ?>
<?php do_action( 'blocksy-tainacan-single-item-metadata-end' ); ?> <?php do_action( 'tainacan-blocksy-single-item-metadata-end' ); ?>
</div> </div>
</section> </section>

View File

@ -3,8 +3,8 @@
/** /**
* Checks is the current activate theme is blocksy * Checks is the current activate theme is blocksy
*/ */
if ( !function_exists('blocksy_tainacan_is_blocksy_activated') ) { if ( !function_exists('tainacan_blocksy_is_blocksy_activated') ) {
function blocksy_tainacan_is_blocksy_activated() { function tainacan_blocksy_is_blocksy_activated() {
$theme = wp_get_theme(); $theme = wp_get_theme();
$is_correct_theme = strpos( $theme->get_stylesheet(), 'blocksy' ) !== false; $is_correct_theme = strpos( $theme->get_stylesheet(), 'blocksy' ) !== false;
@ -23,26 +23,26 @@ if ( !function_exists('blocksy_tainacan_is_blocksy_activated') ) {
/** /**
* Gets plugin or theme directory URL * Gets plugin or theme directory URL
*/ */
if ( !function_exists('blocksy_tainacan_get_plugin_dir_url') ) { if ( !function_exists('tainacan_blocksy_get_plugin_dir_url') ) {
function blocksy_tainacan_get_plugin_dir_url() { function tainacan_blocksy_get_plugin_dir_url() {
return !BLOCKSY_TAINACAN_IS_CHILD_THEME ? plugin_dir_url(__FILE__) : get_stylesheet_directory_uri(); return !TAINACAN_BLOCKSY_IS_CHILD_THEME ? plugin_dir_url(__FILE__) : get_stylesheet_directory_uri();
} }
} }
/** /**
* Gets plugin or theme directory path * Gets plugin or theme directory path
*/ */
if ( !function_exists('blocksy_tainacan_get_plugin_dir_path') ) { if ( !function_exists('tainacan_blocksy_get_plugin_dir_path') ) {
function blocksy_tainacan_get_plugin_dir_path() { function tainacan_blocksy_get_plugin_dir_path() {
return !BLOCKSY_TAINACAN_IS_CHILD_THEME ? plugin_dir_path(__FILE__) : get_stylesheet_directory(); return !TAINACAN_BLOCKSY_IS_CHILD_THEME ? plugin_dir_path(__FILE__) : get_stylesheet_directory();
} }
} }
/** /**
* Manages correct template location in plugin * Manages correct template location in plugin
*/ */
if ( !function_exists('blocksy_tainacan_get_template_part') ) { if ( !function_exists('tainacan_blocksy_get_template_part') ) {
function blocksy_tainacan_get_template_part($path) { function tainacan_blocksy_get_template_part($path) {
return !BLOCKSY_TAINACAN_IS_CHILD_THEME ? include(BLOCKSY_TAINACAN_PLUGIN_DIR_PATH . '/' . $path . '.php') : get_template_part($path); return !TAINACAN_BLOCKSY_IS_CHILD_THEME ? include(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/' . $path . '.php') : get_template_part($path);
} }
} }