Creates TAINACAN_INTERFACE_VERSION constant to help us avoid cache errors when loading css and js.

This commit is contained in:
mateuswetah 2020-05-04 17:51:11 -03:00
parent 892f87ac6d
commit aab69251e5
3 changed files with 12 additions and 9 deletions

View File

@ -1,5 +1,8 @@
<?php
/** Theme version */
const TAINACAN_INTERFACE_VERSION = '2.0';
/**
* Setup Theme
*/
@ -320,7 +323,7 @@ function tainacan_customizer_gutenberg_colors() {
function tainacan_editor_styles() {
// Adds Tainacan editor style for Gutenberg.
wp_enqueue_style( 'tainacan-editor-style', get_template_directory_uri() . '/editor-style.css' );
wp_enqueue_style( 'tainacan-editor-style', get_template_directory_uri() . '/editor-style.css', [], TAINACAN_INTERFACE_VERSION );
// Adds Robot fonts to Gutenberg.
wp_enqueue_style( 'RobotoFonts', 'https://fonts.googleapis.com/css?family=Roboto:400,400i,500,500i,700,700i' );

View File

@ -19,7 +19,7 @@ class TainacanThemeCollectionColor {
function action_tainacan_enqueue_admin_scripts() {
wp_enqueue_script( 'tainacan_colorWell', get_template_directory_uri() . '/assets/js/collection-color.js', false, false, true );
wp_enqueue_style( 'tainacan_colorWellStyle', get_template_directory_uri() . '/assets/css/collection-color.css' );
wp_enqueue_style( 'tainacan_colorWellStyle', get_template_directory_uri() . '/assets/css/collection-color.css', [], TAINACAN_INTERFACE_VERSION );
wp_localize_script( 'tainacan_colorWell', 'tainacan_colorPickerVars', array(
'cancelText' => __( 'Cancel', 'tainacan-interface' ),
'chooseText' => __( 'Choose', 'tainacan-interface' ),

View File

@ -15,7 +15,7 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) {
wp_register_style( 'bootstrap4CSS', get_template_directory_uri() . '/assets/vendor/bootstrap/scss/bootstrap.min.css' );
wp_enqueue_style( 'bootstrap4CSS' );
//Javascript
wp_register_script( 'bootstrap4JS', get_template_directory_uri() . '/assets/vendor/bootstrap/js/bootstrap.min.js', array( 'jquery' ), '', true );
wp_register_script( 'bootstrap4JS', get_template_directory_uri() . '/assets/vendor/bootstrap/js/bootstrap.min.js', array( 'jquery' ), TAINACAN_INTERFACE_VERSION, true );
wp_enqueue_script( 'bootstrap4JS' );
/**
@ -33,9 +33,9 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) {
/**
* Ekko Lightbox
*/
wp_register_style( 'EkkoLightboxCss', get_template_directory_uri() . '/assets/css/ekko-lightbox.css');
wp_register_style( 'EkkoLightboxCss', get_template_directory_uri() . '/assets/css/ekko-lightbox.css', [], TAINACAN_INTERFACE_VERSION);
wp_enqueue_style( 'EkkoLightboxCss' );
wp_register_script( 'EkkoLightboxJs', get_template_directory_uri() . '/assets/js/ekko-lightbox.min.js', array('jquery'), null, true);
wp_register_script( 'EkkoLightboxJs', get_template_directory_uri() . '/assets/js/ekko-lightbox.min.js', array('jquery'), TAINACAN_INTERFACE_VERSION, true);
wp_enqueue_script( 'EkkoLightboxJs' );
/**
@ -47,19 +47,19 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) {
/**
* Tainacan Theme
*/
wp_enqueue_script( 'tainacan_tainacanTruncate', get_template_directory_uri() . '/assets/js/tainacan-interface-truncate.js', array( 'jquery' ), '1.0', false );
wp_enqueue_script( 'tainacan_tainacanTruncate', get_template_directory_uri() . '/assets/js/tainacan-interface-truncate.js', array( 'jquery' ), TAINACAN_INTERFACE_VERSION, false );
wp_localize_script( 'tainacan_tainacanTruncate', 'tainacan_trucanteVars', array(
'moreText' => __( 'Show more', 'tainacan-interface' ),
'lessText' => __( 'Show less', 'tainacan-interface' ),
));
wp_register_style( 'tainacan_tainacanStyle', get_stylesheet_uri(), array( 'bootstrap4CSS' ) );
wp_register_style( 'tainacan_tainacanStyle', get_stylesheet_uri(), array( 'bootstrap4CSS' ), TAINACAN_INTERFACE_VERSION );
wp_enqueue_style( 'tainacan_tainacanStyle' );
wp_register_script( 'tainacan_tainacanJS', get_template_directory_uri() . '/assets/js/js.js', '', '1.0', true );
wp_register_script( 'tainacan_tainacanJS', get_template_directory_uri() . '/assets/js/js.js', '', TAINACAN_INTERFACE_VERSION, true );
wp_enqueue_script( 'tainacan_tainacanJS' );
// Tainacan Icons
wp_register_style( 'TainacanIconsFont', get_template_directory_uri() . '/assets/fonts/tainacan-icons-font/css/tainacanicons.min.css', '', '1.0.2', '' );
wp_register_style( 'TainacanIconsFont', get_template_directory_uri() . '/assets/fonts/tainacan-icons-font/css/tainacanicons.min.css', '', '1.0.3', '' );
wp_enqueue_style( 'TainacanIconsFont' );
/**