Several adjustments to fix errors found on Theme Checker.

This commit is contained in:
mateuswetah 2020-08-18 17:59:44 -03:00
parent ecb3ff8410
commit 114c641c65
15 changed files with 47 additions and 45 deletions

View File

@ -20,19 +20,25 @@ echo "Compiling Sass..."
cd src/assets/scss
sass -E 'UTF-8' style.scss:../../style.css
echo "Style of Tainacan Compiled";
sass -E 'UTF-8' editor-style.scss:../../editor-style.css
echo "Style of Tainacan for Gutenberg Editor Compiled";
sass bootstrap_custom.scss:../vendor/bootstrap/scss/bootstrap.min.css --style compressed
echo "Bootstrap Compiled";
rm -rf .sass-cache
cd ../vendor/slick
sass slick.scss:slick.min.css --style compressed
sass slick-theme.scss:slick-theme.min.css --style compressed
echo "Slick for slider carousel Compiled";
rm -rf slick-theme.min.css.map slick.min.css.map .sass-cache/
cd ../../scss
rm -rf ../style.css.map
# rm -rf ../editor-style.css.map
cd ../../../
rm -rf style.css.map
rm -rf editor-style.css.map
rm -rf assets/vendor/bootstrap/scss/bootstrap.min.css.map
echo "CSS map files removed";
echo "Sass compilation Completed!"
exit 0

View File

@ -2,8 +2,11 @@
Theme Name: Tainacan Interface
Author: Tainacan
Author URI: https://tainacan.org
Theme URI: https://tainacan.org/blog/category/tema/
Description: This is the default theme for the Tainacan project. Use this in conjunction with Tainacan plugin to easily manage and publish you digital collectinons with a beautiful faceted search interface. Ideal for museums, galleries, libraries and anyone who have a digital repository.
Version: 2.1
Tested up to: 5.5
Requires PHP: 5.6
License: GNU General Public License v3
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
Tags: two-columns, right-sidebar, grid-layout, flexible-header, custom-colors, custom-header, custom-menu, custom-logo, featured-images, footer-widgets, theme-options, threaded-comments, translation-ready, photography, portfolio

File diff suppressed because one or more lines are too long

View File

@ -192,7 +192,7 @@ add_action( 'admin_head', 'tainacan_customize_editor_css');
*/
function tainacan_include_items_in_search_results( $query ) {
if ( defined ('TAINACAN_VERSION') && $query->get( 'post_type' ) !== 'tainacan-collection' && !$_GET['onlyposts'] && !$_GET['onlypages'] && $query->is_main_query() && $query->is_search() && ! is_admin()) {
if ( defined ('TAINACAN_VERSION') && $query->get( 'post_type' ) !== 'tainacan-collection' && (!isset($_GET['onlyposts']) || !$_GET['onlyposts']) && (!isset($_GET['onlypages']) || !$_GET['onlypages']) && $query->is_main_query() && $query->is_search() && ! is_admin()) {
$collections_post_types = \Tainacan\Repositories\Repository::get_collections_db_identifiers();
$existing_post_types = $query->get( 'post_type' );
@ -200,9 +200,9 @@ function tainacan_include_items_in_search_results( $query ) {
$existing_post_types = [ $existing_post_types ];
$query->set( 'post_type', array_merge( $existing_post_types, ['post', 'page', 'tainacan-collection'], $collections_post_types ) );
} else if ( $_GET['onlypages'] && $query->is_main_query() && $query->is_search() && ! is_admin() ) {
} else if ( isset($_GET['onlypages']) && $_GET['onlypages'] && $query->is_main_query() && $query->is_search() && ! is_admin() ) {
$query->set( 'post_type', 'pages' );
} else if ( $_GET['onlyposts'] && $query->is_main_query() && $query->is_search() && ! is_admin() ) {
} else if ( isset($_GET['onlyposts']) && $_GET['onlyposts'] && $query->is_main_query() && $query->is_search() && ! is_admin() ) {
$query->set( 'post_type', 'post' );
}
}

View File

@ -143,7 +143,7 @@ function tainacan_customize_register( $wp_customize ) {
'settings' => 'tainacan_search_global_label',
'section' => 'tainacan_header_search',
'label' => __( 'Label for "Global" search option', 'tainacan-interface' ),
'description' => __( 'The Global search is the default. Its option will only be visible if at least one of the bellow are selected.')
'description' => __( 'The Global search is the default. Its option will only be visible if at least one of the bellow are selected.', 'tainacan-interface')
) );
// Option to search directly on repository items list

View File

@ -10,7 +10,14 @@
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
do_action( 'wp_body_open' );
}
?>
<nav class="navbar navbar-expand-md navbar-light bg-white menu-shadow px-0 navbar--border-bottom">
<div class="container-fluid max-large px-0 margin-one-column" id="topNavbar">
<?php echo tainacan_get_logo(); ?>

View File

@ -17,7 +17,7 @@
name="archive"
checked="checked"
id="search-global">
<?php echo get_theme_mod('tainacan_search_global_label', __( 'Global', 'tainacan-interface' ) ); ?>
<?php echo esc_html( get_theme_mod('tainacan_search_global_label', __( 'Global', 'tainacan-interface' ) ) ); ?>
</label>
<?php if ( get_theme_mod('tainacan_search_on_posts', false) ) : ?>
@ -27,7 +27,7 @@
value="posts"
name="archive"
id="search-on-posts">
<?php echo get_theme_mod('tainacan_search_on_posts_label', __( 'Posts', 'tainacan-interface' ) ); ?>
<?php echo esc_html( get_theme_mod('tainacan_search_on_posts_label', __( 'Posts', 'tainacan-interface' ) ) ); ?>
</label>
<?php endif;
@ -39,7 +39,7 @@
value="pages"
name="archive"
id="search-on-pages">
<?php echo get_theme_mod('tainacan_search_on_pages_label', __( 'Pages', 'tainacan-interface' ) ); ?>
<?php echo esc_html( get_theme_mod('tainacan_search_on_pages_label', __( 'Pages', 'tainacan-interface' ) ) ); ?>
</label>
<?php endif;
@ -51,7 +51,7 @@
value="tainacan-items"
name="archive"
id="search-on-items">
<?php echo get_theme_mod('tainacan_search_on_items_label', __( 'Items', 'tainacan-interface' ) ); ?>
<?php echo esc_html( get_theme_mod('tainacan_search_on_items_label', __( 'Items', 'tainacan-interface' ) ) ); ?>
</label>
<?php endif;
@ -63,7 +63,7 @@
value="tainacan-collections"
name="archive"
id="search-on-collections">
<?php echo get_theme_mod('tainacan_search_on_collections_label', __( 'Collections', 'tainacan-interface' ) ); ?>
<?php echo esc_html( get_theme_mod('tainacan_search_on_collections_label', __( 'Collections', 'tainacan-interface' ) ) ); ?>
</label>
<?php endif; ?>

File diff suppressed because one or more lines are too long

View File

@ -43,28 +43,28 @@ $src = wp_get_attachment_image_src($image, 'full');
<p class="share-title"><?php _e('Share', 'tainacan-interface'); ?></p>
<?php if ( true == get_theme_mod( 'tainacan_facebook_share', true ) ) : ?>
<a href="http://www.facebook.com/sharer.php?u=<?php echo get_term_link((int) $current_term->get_id()); ?>" title="<?php esc_attr_e('Share this on facebook', 'tainacan-interface') ?>" class="share-link" target="_blank">
<img src="<?php echo get_template_directory_uri() . '/assets/images/facebook-circle.png'; ?>" alt="<?php esc_attr_e('Share this on facebook', 'tainacan-interface') ?>" class="share-images">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/facebook-circle.png'; ?>" alt="<?php esc_attr_e('Share this on facebook', 'tainacan-interface') ?>" class="share-images">
</a>
<?php endif; ?>
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) ) : ?>
<?php $twitter_option = get_option( 'tainacan_twitter_user' ); ?>
<?php $via = ! empty( $twitter_option ) ? '&amp;via=' . esc_attr( get_option( 'tainacan_twitter_user' ) ) : ''; ?>
<a href="http://twitter.com/share?url=<?php echo get_term_link((int) $current_term->get_id()); ?>&amp;text=<?php echo $current_taxonomy->labels->name . ':' . $current_term->get_name(); ?><?php echo $via; ?>" target="_blank" title="<?php esc_attr_e('Share this on twitter', 'tainacan-interface') ?>" class="share-link">
<img src="<?php echo get_template_directory_uri() . '/assets/images/twitter-circle.png'; ?>" alt="<?php esc_attr_e('Share this on twitter', 'tainacan-interface') ?>" class="share-images">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/twitter-circle.png'; ?>" alt="<?php esc_attr_e('Share this on twitter', 'tainacan-interface') ?>" class="share-images">
</a>
<?php endif; ?>
<?php if ( true == get_theme_mod( 'tainacan_whatsapp_share', false ) ) : ?>
<a href="https://api.whatsapp.com/send?1=pt_BR&text=<?php echo get_term_link((int) $current_term->get_id()); ?>" class="share-link" target="_blank" title="<?php esc_attr_e('Share this on WhatsApp', 'tainacan-interface') ?>">
<img src="<?php echo get_template_directory_uri() . '/assets/images/whatsapp-circle.png'; ?>" alt="<?php esc_attr_e('Share this on WhatsApp', 'tainacan-interface') ?>" class="share-images">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/whatsapp-circle.png'; ?>" alt="<?php esc_attr_e('Share this on WhatsApp', 'tainacan-interface') ?>" class="share-images">
</a>
<?php endif; ?>
<?php if ( true == get_theme_mod( 'tainacan_telegram_share', false ) ) : ?>
<a href="https://t.me/share/url?url=<?php echo get_term_link((int) $current_term->get_id()); ?>" class="share-link" target="_blank" title="<?php esc_attr_e('Share this on Telegram', 'tainacan-interface') ?>">
<img src="<?php echo get_template_directory_uri() . '/assets/images/telegram-circle.png'; ?>" alt="<?php esc_attr_e('Share this on Telegram', 'tainacan-interface') ?>" class="share-images">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/telegram-circle.png'; ?>" alt="<?php esc_attr_e('Share this on Telegram', 'tainacan-interface') ?>" class="share-images">
</a>
<?php endif; ?>
<button onclick="copyTextToClipboard('<?php echo get_term_link((int) $current_term->get_id()); ?>')" title="<?php esc_attr_e('Copy link', 'tainacan-interface') ?>" class="share-link tainacan-copy-link-button">
<img src="<?php echo get_template_directory_uri() . '/assets/images/url-circle.png'; ?>" alt="<?php esc_attr_e('Copy link', 'tainacan-interface') ?>" class="share-images">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/url-circle.png'; ?>" alt="<?php esc_attr_e('Copy link', 'tainacan-interface') ?>" class="share-images">
</button>
</div>
</div>

View File

@ -1,5 +1,5 @@
<?php
if ( defined ('TAINACAN_VERSION') && !$_GET['onlyposts'] && !$_GET['onlypages'] && is_search() ) {
if ( defined ('TAINACAN_VERSION') && (!isset($_GET['onlyposts']) || !$_GET['onlyposts']) && (!isset($_GET['onlypages']) || !$_GET['onlypages']) && is_search() ) {
$post_type = get_post_type();
$post_type_object = get_post_type_object($post_type);
$post_type_label = $post_type_object->labels->singular_name;
@ -15,7 +15,7 @@
</div>
<?php endif; ?>
<div class="col-xs-12 blog-content <?php if ( has_post_thumbnail() ) :?>col-md-8 blog-flex<?php else : ?>col-md-12<?php endif; ?> align-self-center">
<?php if ( defined ('TAINACAN_VERSION') && !$_GET['onlyposts'] && !$_GET['onlypages'] && is_search() ) : ?>
<?php if ( defined ('TAINACAN_VERSION') && (!isset($_GET['onlyposts']) || !$_GET['onlyposts']) && (!isset($_GET['onlypages']) || !$_GET['onlypages']) && is_search() ) : ?>
<div class="title-area">
<h3 class="mb-3">
<a href="<?php the_permalink(); ?>" class="font-weight-bold"><?php the_title(); ?></a>

View File

@ -22,12 +22,12 @@
<div class="mt-3 tainacan-single-post">
<?php if ( !get_theme_mod( 'tainacan_single_item_gallery_mode', false ) && get_theme_mod('tainacan_single_item_attachments_section_label', __( 'Attachments', 'tainacan-interface' )) != '') : ?>
<h2 class="title-content-items" id="single-item-attachments-label">
<?php echo get_theme_mod('tainacan_single_item_attachments_section_label', __( 'Attachments', 'tainacan-interface' )); ?>
<?php echo esc_html( get_theme_mod('tainacan_single_item_attachments_section_label', __( 'Attachments', 'tainacan-interface' )) ); ?>
</h2>
<?php endif; ?>
<?php if ( get_theme_mod( 'tainacan_single_item_gallery_mode', false ) && get_theme_mod('tainacan_single_item_documents_section_label', __( 'Documents', 'tainacan-interface' )) != '') : ?>
<h2 class="title-content-items" id="single-item-documents-label">
<?php echo get_theme_mod('tainacan_single_item_documents_section_label', __( 'Documents', 'tainacan-interface' )); ?>
<?php echo esc_html( get_theme_mod('tainacan_single_item_documents_section_label', __( 'Documents', 'tainacan-interface' )) ); ?>
</h2>
<?php endif; ?>
<section class="tainacan-content single-item-collection margin-two-column">

View File

@ -2,7 +2,7 @@
<div class="mt-3 tainacan-single-post">
<?php if ( get_theme_mod('tainacan_single_item_document_section_label', __( 'Document', 'tainacan-interface' )) != '') : ?>
<h2 class="title-content-items" id="single-item-document-label">
<?php echo get_theme_mod('tainacan_single_item_document_section_label', __( 'Document', 'tainacan-interface' )); ?>
<?php echo esc_html( get_theme_mod('tainacan_single_item_document_section_label', __( 'Document', 'tainacan-interface' )) ); ?>
</h2>
<?php endif; ?>
<section class="tainacan-content single-item-collection margin-two-column">

View File

@ -2,7 +2,7 @@
<?php if ( get_theme_mod('tainacan_single_item_metadata_section_label', '') != '') : ?>
<h2 class="title-content-items" id="single-item-metadata-label">
<?php echo get_theme_mod('tainacan_single_item_metadata_section_label', ''); ?>
<?php echo esc_html( get_theme_mod('tainacan_single_item_metadata_section_label', '') ); ?>
</h2>
<?php endif; ?>
<section class="tainacan-content single-item-collection margin-two-column">
@ -38,16 +38,16 @@
<?php endif; ?>
<?php if ( true == get_theme_mod( 'tainacan_whatsapp_share', false ) ) : ?>
<a href="https://api.whatsapp.com/send?1=pt_BR&text=<?php the_permalink(); ?>" target="_blank" class="item-card-link--sharing" title="<?php esc_attr_e('Share this on WhatsApp', 'tainacan-interface') ?>">
<img src="<?php echo get_template_directory_uri() . '/assets/images/whatsapp-circle.png'; ?>" alt="<?php esc_attr_e('Share this on WhatsApp', 'tainacan-interface') ?>">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/whatsapp-circle.png'; ?>" alt="<?php esc_attr_e('Share this on WhatsApp', 'tainacan-interface') ?>">
</a>
<?php endif; ?>
<?php if ( true == get_theme_mod( 'tainacan_telegram_share', false ) ) : ?>
<a href="https://t.me/share/url?url=<?php the_permalink(); ?>" target="_blank" class="item-card-link--sharing" title="<?php esc_attr_e('Share this on Telegram', 'tainacan-interface') ?>">
<img src="<?php echo get_template_directory_uri() . '/assets/images/telegram-circle.png'; ?>" alt="<?php esc_attr_e('Share this on Telegram', 'tainacan-interface') ?>">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/telegram-circle.png'; ?>" alt="<?php esc_attr_e('Share this on Telegram', 'tainacan-interface') ?>">
</a>
<?php endif; ?>
<button onclick="copyTextToClipboard('<?php the_permalink(); ?>')" title="<?php esc_attr_e('Copy link', 'tainacan-interface') ?>" class="item-card-link--sharing tainacan-copy-link-button">
<img src="<?php echo get_template_directory_uri() . '/assets/images/url-circle.png'; ?>" alt="<?php esc_attr_e('Copy link', 'tainacan-interface') ?>">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/url-circle.png'; ?>" alt="<?php esc_attr_e('Copy link', 'tainacan-interface') ?>">
</button>
</div>
</div>

View File

@ -32,7 +32,7 @@
<?php if ( get_theme_mod('tainacan_single_item_navigation_section_label', __( 'Continue browsing', 'tainacan-interface' )) != '') : ?>
<h2 class="mb-0 title-content-items" id="single-item-navigation-label">
<?php echo get_theme_mod('tainacan_single_item_navigation_section_label', __('Continue browsing', 'tainacan-interface')); ?>
<?php echo esc_html( get_theme_mod( 'tainacan_single_item_navigation_section_label', __('Continue browsing', 'tainacan-interface') ) ); ?>
</h2>
<?php endif; ?>

View File

@ -20,16 +20,16 @@
<?php endif; ?>
<?php if ( true == get_theme_mod( 'tainacan_whatsapp_share', false ) ) : ?>
<a href="https://api.whatsapp.com/send?1=pt_BR&text=<?php the_permalink(); ?>" target="_blank" title="<?php esc_attr_e('Share this on WhatsApp', 'tainacan-interface') ?>">
<img src="<?php echo get_template_directory_uri() . '/assets/images/whatsapp-circle.png'; ?>" alt="<?php esc_attr_e('Share this on WhatsApp', 'tainacan-interface') ?>" class="share-images">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/whatsapp-circle.png'; ?>" alt="<?php esc_attr_e('Share this on WhatsApp', 'tainacan-interface') ?>" class="share-images">
</a>
<?php endif; ?>
<?php if ( true == get_theme_mod( 'tainacan_telegram_share', false ) ) : ?>
<a href="https://t.me/share/url?url=<?php the_permalink(); ?>" target="_blank" title="<?php esc_attr_e('Share this on Telegram', 'tainacan-interface') ?>">
<img src="<?php echo get_template_directory_uri() . '/assets/images/telegram-circle.png'; ?>" alt="<?php esc_attr_e('Share this on Telegram', 'tainacan-interface') ?>" class="share-images">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/telegram-circle.png'; ?>" alt="<?php esc_attr_e('Share this on Telegram', 'tainacan-interface') ?>" class="share-images">
</a>
<?php endif; ?>
<button onclick="copyTextToClipboard('<?php the_permalink(); ?>')" title="<?php esc_attr_e('Copy link', 'tainacan-interface') ?>" class="tainacan-copy-link-button">
<img src="<?php echo get_template_directory_uri() . '/assets/images/url-circle.png'; ?>" alt="<?php esc_attr_e('Copy link', 'tainacan-interface') ?>" class="share-images">
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/url-circle.png'; ?>" alt="<?php esc_attr_e('Copy link', 'tainacan-interface') ?>" class="share-images">
</button>
</div>
</div>