Fixed theme sniffer to Wordpress Core
This commit is contained in:
parent
2b2bb08390
commit
4550ec8701
|
@ -9,33 +9,32 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
if (settings) {
|
if (settings) {
|
||||||
$.extend(config, settings);
|
$.extend( config, settings );
|
||||||
}
|
}
|
||||||
|
|
||||||
var minimized_elements = $(this);
|
var minimized_elements = $( this );
|
||||||
|
|
||||||
minimized_elements.each(function(){
|
minimized_elements.each(function(){
|
||||||
var t = $(this).text();
|
var t = $( this ).text();
|
||||||
if(t.length < config.minChars) return;
|
if (t.length < config.minChars) { return };
|
||||||
|
|
||||||
$(this).html(
|
$( this ).html(
|
||||||
t.slice(0,config.showChars)+'<span>'+ config.ellipsesText +' </span><a href="#" class="tainacan-interface-more">[ '+ config.moreText +' ]</a>'+
|
t.slice( 0,config.showChars ) + '<span>' + config.ellipsesText + ' </span><a href="#" class="tainacan-interface-more">[ ' + config.moreText + ' ]</a>' + '<span style="display:none;">' + t.slice( config.showChars,t.length ) + ' <a href="#" class="tainacan-interface-less">[ ' + config.lessText + ' ]</a></span>'
|
||||||
'<span style="display:none;">'+ t.slice(config.showChars,t.length)+' <a href="#" class="tainacan-interface-less">[ '+ config.lessText +' ]</a></span>'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('a.tainacan-interface-more', minimized_elements).click(function(event){
|
|
||||||
event.preventDefault();
|
|
||||||
minimized_elements.addClass('full-story');
|
|
||||||
$(this).hide().prev().hide();
|
|
||||||
$(this).next().show();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('a.tainacan-interface-less', minimized_elements).click(function(event){
|
$( 'a.tainacan-interface-more', minimized_elements ).click(function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
minimized_elements.removeClass('full-story');
|
minimized_elements.addClass( 'full-story' );
|
||||||
$(this).parent().hide().prev().show().prev().show();
|
$( this ).hide().prev().hide();
|
||||||
|
$( this ).next().show();
|
||||||
|
});
|
||||||
|
|
||||||
|
$( 'a.tainacan-interface-less', minimized_elements ).click(function(event){
|
||||||
|
event.preventDefault();
|
||||||
|
minimized_elements.removeClass( 'full-story' );
|
||||||
|
$( this ).parent().hide().prev().show().prev().show();
|
||||||
});
|
});
|
||||||
return minimized_elements;
|
return minimized_elements;
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
echo '</p><p>';
|
echo '</p><p>';
|
||||||
}
|
}
|
||||||
if ( get_option( 'tainacan_blogaddress' ) ) {
|
if ( get_option( 'tainacan_blogaddress' ) ) {
|
||||||
echo wp_filter_nohtml_kses(get_option( 'tainacan_blogaddress', '' ));
|
echo wp_filter_nohtml_kses( get_option( 'tainacan_blogaddress', '' ) );
|
||||||
} ?>
|
} ?>
|
||||||
</p>
|
</p>
|
||||||
<p class="tainacan-footer-info--blog">
|
<p class="tainacan-footer-info--blog">
|
||||||
<?php if ( get_option( 'tainacan_blogemail' ) ) {
|
<?php if ( get_option( 'tainacan_blogemail' ) ) {
|
||||||
printf( __( 'E-mail: %s', 'tainacan-interface' ), sanitize_email(get_option( 'tainacan_blogemail', '' )) );
|
printf( __( 'E-mail: %s', 'tainacan-interface' ), sanitize_email( get_option( 'tainacan_blogemail', '' ) ) );
|
||||||
}
|
}
|
||||||
if ( get_option( 'tainacan_blogemail' ) && get_option( 'tainacan_blogphone' ) ) {
|
if ( get_option( 'tainacan_blogemail' ) && get_option( 'tainacan_blogphone' ) ) {
|
||||||
if ( wp_is_mobile() ) :
|
if ( wp_is_mobile() ) :
|
||||||
|
@ -35,12 +35,12 @@ if ( get_option( 'tainacan_blogemail' ) && get_option( 'tainacan_blogphone' ) )
|
||||||
endif;
|
endif;
|
||||||
}
|
}
|
||||||
if ( get_option( 'tainacan_blogphone' ) ) {
|
if ( get_option( 'tainacan_blogphone' ) ) {
|
||||||
printf( __( 'Telephone: %s', 'tainacan-interface' ), wp_filter_nohtml_kses(get_option( 'tainacan_blogphone', '' )) );
|
printf( __( 'Telephone: %s', 'tainacan-interface' ), wp_filter_nohtml_kses( get_option( 'tainacan_blogphone', '' ) ) );
|
||||||
} ?>
|
} ?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto pr-0 pr-md-3 d-none d-md-block align-self-md-top">
|
<div class="col-auto pr-0 pr-md-3 d-none d-md-block align-self-md-top">
|
||||||
<img src="<?php if ( get_theme_mod( 'tainacan_footer_logo' ) ) { echo esc_attr(get_theme_mod( 'tainacan_footer_logo' )); } ?>" class="tainacan-footer-info--logo" alt="">
|
<img src="<?php if ( get_theme_mod( 'tainacan_footer_logo' ) ) { echo esc_attr( get_theme_mod( 'tainacan_footer_logo' ) ); } ?>" class="tainacan-footer-info--logo" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 tainacan-powered">
|
<div class="col-12 tainacan-powered">
|
||||||
<span>
|
<span>
|
||||||
|
|
|
@ -125,11 +125,11 @@ add_action( 'widgets_init', 'tainacan_widgets_footer_init' );
|
||||||
function tainacan_get_logo() {
|
function tainacan_get_logo() {
|
||||||
if ( has_custom_logo() ) {
|
if ( has_custom_logo() ) {
|
||||||
return get_custom_logo();
|
return get_custom_logo();
|
||||||
} else {
|
} else {
|
||||||
$html = '<a class="navbar-brand tainacan-logo" href="' . esc_url( home_url() ) . '">';
|
$html = '<a class="navbar-brand tainacan-logo" href="' . esc_url( home_url() ) . '">';
|
||||||
$html .= '<h1>'. get_bloginfo( 'name' ) .'</h1>';
|
$html .= '<h1>' . get_bloginfo( 'name' ) . '</h1>';
|
||||||
$html .= '</a>';
|
$html .= '</a>';
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,13 @@ class TainacanThemeCollectionColor {
|
||||||
wp_enqueue_script( 'tainacan_colorWell', get_template_directory_uri() . '/functions/collection-color.js', false, false, true );
|
wp_enqueue_script( 'tainacan_colorWell', get_template_directory_uri() . '/functions/collection-color.js', false, false, true );
|
||||||
wp_enqueue_style( 'tainacan_colorWellStyle', get_template_directory_uri() . '/functions/collection-color.css' );
|
wp_enqueue_style( 'tainacan_colorWellStyle', get_template_directory_uri() . '/functions/collection-color.css' );
|
||||||
wp_localize_script( 'tainacan_colorWell', 'tainacan_colorPickerVars', array(
|
wp_localize_script( 'tainacan_colorWell', 'tainacan_colorPickerVars', array(
|
||||||
'cancelText' => __("cancel", 'tainacan-interface'),
|
'cancelText' => __( 'cancel', 'tainacan-interface' ),
|
||||||
'chooseText' => __("choose", 'tainacan-interface'),
|
'chooseText' => __( 'choose', 'tainacan-interface' ),
|
||||||
'togglePaletteMoreText' => __("more", 'tainacan-interface'),
|
'togglePaletteMoreText' => __( 'more', 'tainacan-interface' ),
|
||||||
'togglePaletteLessText' => __("less", 'tainacan-interface'),
|
'togglePaletteLessText' => __( 'less', 'tainacan-interface' ),
|
||||||
'clearText' => __("Clear Color Selection", 'tainacan-interface'),
|
'clearText' => __( 'Clear Color Selection', 'tainacan-interface' ),
|
||||||
'noColorSelectedText' => __("No Color Selected", 'tainacan-interface'),
|
'noColorSelectedText' => __( 'No Color Selected', 'tainacan-interface' ),
|
||||||
) );
|
));
|
||||||
|
|
||||||
wp_enqueue_script( 'tainacan_Spectrum', get_template_directory_uri() . '/assets/js/spectrum.js', false, false, true );
|
wp_enqueue_script( 'tainacan_Spectrum', get_template_directory_uri() . '/assets/js/spectrum.js', false, false, true );
|
||||||
wp_enqueue_style( 'tainacan_Spectrum', get_template_directory_uri() . '/assets/js/spectrum.css' );
|
wp_enqueue_style( 'tainacan_Spectrum', get_template_directory_uri() . '/assets/js/spectrum.css' );
|
||||||
|
|
|
@ -36,8 +36,8 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) {
|
||||||
/**
|
/**
|
||||||
* Google
|
* Google
|
||||||
*/
|
*/
|
||||||
// Google fonts Roboto
|
// Google fonts Roboto
|
||||||
wp_enqueue_style( 'tainacan_RobotoFonts', 'https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i' );
|
wp_enqueue_style( 'tainacan_RobotoFonts', 'https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i' );
|
||||||
// Material Icons
|
// Material Icons
|
||||||
wp_register_style( 'tainacan_MaterialIconsFonts', get_template_directory_uri() . '/assets/fonts/material-design-icons/css/materialdesignicons.min.css', '', '2.4.85', '' );
|
wp_register_style( 'tainacan_MaterialIconsFonts', get_template_directory_uri() . '/assets/fonts/material-design-icons/css/materialdesignicons.min.css', '', '2.4.85', '' );
|
||||||
wp_enqueue_style( 'tainacan_MaterialIconsFonts' );
|
wp_enqueue_style( 'tainacan_MaterialIconsFonts' );
|
||||||
|
@ -47,8 +47,8 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) {
|
||||||
*/
|
*/
|
||||||
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' ), '1.0', false );
|
||||||
wp_localize_script( 'tainacan_tainacanTruncate', 'tainacan_trucanteVars', array(
|
wp_localize_script( 'tainacan_tainacanTruncate', 'tainacan_trucanteVars', array(
|
||||||
"moreText" => __('More', 'tainacan-interface'),
|
'moreText' => __( 'More', 'tainacan-interface' ),
|
||||||
"lessText" => __('Less', 'tainacan-interface')
|
'lessText' => __( 'Less', 'tainacan-interface' ),
|
||||||
));
|
));
|
||||||
|
|
||||||
wp_register_style( 'tainacan_tainacanStyle', get_stylesheet_uri(), array( 'tainacan_bootstrap4CSS' ) );
|
wp_register_style( 'tainacan_tainacanStyle', get_stylesheet_uri(), array( 'tainacan_bootstrap4CSS' ) );
|
||||||
|
|
|
@ -24,11 +24,11 @@ function tainacan_comments_callback( $comment, $args, $depth ) {
|
||||||
</a>
|
</a>
|
||||||
<p class="comment-time text-oslo-gray my-sm-1">
|
<p class="comment-time text-oslo-gray my-sm-1">
|
||||||
<?php
|
<?php
|
||||||
printf(
|
printf(
|
||||||
/* translators: 1: Comment date, 2: comment time. Example: April 21st at 15:25*/
|
/* translators: 1: Comment date, 2: comment time. Example: April 21st at 15:25*/
|
||||||
__('%1$s at %2$s.', 'tainacan-interface'),
|
__( '%1$s at %2$s.', 'tainacan-interface' ),
|
||||||
get_comment_date(),
|
get_comment_date(),
|
||||||
get_comment_time()
|
get_comment_time()
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
|
@ -137,9 +137,7 @@ function tainacan_social_meta() {
|
||||||
<meta property="og:image:height" content="<?php echo $image['height']; ?>"/>
|
<meta property="og:image:height" content="<?php echo $image['height']; ?>"/>
|
||||||
|
|
||||||
|
|
||||||
<?php } else {
|
<?php } else { return; } // End if().
|
||||||
return;
|
|
||||||
} // End if().
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action( 'wp_head', 'tainacan_social_meta', 5 );
|
add_action( 'wp_head', 'tainacan_social_meta', 5 );
|
||||||
|
|
|
@ -7,4 +7,4 @@
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -119,7 +119,7 @@
|
||||||
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) ) : ?>
|
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) ) : ?>
|
||||||
<?php
|
<?php
|
||||||
$twitter_option = get_option( 'tainacan_twitter_user' );
|
$twitter_option = get_option( 'tainacan_twitter_user' );
|
||||||
$via = ! empty( $twitter_option ) ? '&via=' . esc_attr(get_option( 'tainacan_twitter_user' )) : '';
|
$via = ! empty( $twitter_option ) ? '&via=' . esc_attr( get_option( 'tainacan_twitter_user' ) ) : '';
|
||||||
?>
|
?>
|
||||||
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php the_title_attribute(); ?><?php echo $via; ?>" target="_blank" class="item-card-link--sharing">
|
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php the_title_attribute(); ?><?php echo $via; ?>" target="_blank" class="item-card-link--sharing">
|
||||||
<img src="<?php echo get_template_directory_uri() . '/assets/images/twitter-circle.png'; ?>" alt="">
|
<img src="<?php echo get_template_directory_uri() . '/assets/images/twitter-circle.png'; ?>" alt="">
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) && get_option( 'tainacan_twitter_user' ) ) : ?>
|
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) && get_option( 'tainacan_twitter_user' ) ) : ?>
|
||||||
<div class="rotater">
|
<div class="rotater">
|
||||||
<a href="http://twitter.com/share?url=<?php echo home_url( $wp->request ); ?>&text=<?php the_title_attribute(); ?>&via=<?php echo esc_attr(get_option( 'tainacan_twitter_user', '' )); ?>" target="_blank">
|
<a href="http://twitter.com/share?url=<?php echo home_url( $wp->request ); ?>&text=<?php the_title_attribute(); ?>&via=<?php echo esc_attr( get_option( 'tainacan_twitter_user', '' ) ); ?>" target="_blank">
|
||||||
<div class="btn btn-icon">
|
<div class="btn btn-icon">
|
||||||
<i class="mdi mdi-twitter"></i>
|
<i class="mdi mdi-twitter"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -70,7 +70,7 @@ echo '</style>';
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) && get_option( 'tainacan_twitter_user' ) ) : ?>
|
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) && get_option( 'tainacan_twitter_user' ) ) : ?>
|
||||||
<div class="rotater">
|
<div class="rotater">
|
||||||
<a href="http://twitter.com/share?url=<?php echo home_url( $wp->request ); ?>&text=<?php the_title_attribute(); ?>&via=<?php echo esc_attr(get_option( 'tainacan_twitter_user', '' )); ?>" target="_blank">
|
<a href="http://twitter.com/share?url=<?php echo home_url( $wp->request ); ?>&text=<?php the_title_attribute(); ?>&via=<?php echo esc_attr( get_option( 'tainacan_twitter_user', '' ) ); ?>" target="_blank">
|
||||||
<div class="btn btn-icon">
|
<div class="btn btn-icon">
|
||||||
<i class="mdi mdi-twitter"></i>
|
<i class="mdi mdi-twitter"></i>
|
||||||
</div>
|
</div>
|
||||||
|
@ -102,4 +102,4 @@ echo '</style>';
|
||||||
<?php do_action( 'tainacan-interface-collection-header-bottom' ); ?>
|
<?php do_action( 'tainacan-interface-collection-header-bottom' ); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) ) : ?>
|
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) ) : ?>
|
||||||
<?php $twitter_option = get_option( 'tainacan_twitter_user' ); ?>
|
<?php $twitter_option = get_option( 'tainacan_twitter_user' ); ?>
|
||||||
<?php $via = ! empty( $twitter_option ) ? '&via=' . esc_attr(get_option( 'tainacan_twitter_user' )) : ''; ?>
|
<?php $via = ! empty( $twitter_option ) ? '&via=' . esc_attr( get_option( 'tainacan_twitter_user' ) ) : ''; ?>
|
||||||
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php the_title_attribute(); ?><?php echo $via; ?>" target="_blank" class="">
|
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php the_title_attribute(); ?><?php echo $via; ?>" target="_blank" class="">
|
||||||
<img src="<?php echo get_template_directory_uri() . '/assets/images/twitter-circle.png'; ?>" alt="">
|
<img src="<?php echo get_template_directory_uri() . '/assets/images/twitter-circle.png'; ?>" alt="">
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in New Issue