mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-06-05 15:08:20 +09:00
add filters for backstretch settings
This commit is contained in:
@@ -121,10 +121,22 @@ class Display_Featured_Image_Genesis_Output {
|
||||
$displaysetting = get_option( 'displayfeaturedimagegenesis' );
|
||||
$keep_titles = $displaysetting['keep_titles'];
|
||||
|
||||
wp_localize_script( 'displayfeaturedimage-backstretch-set', 'BackStretchVars', array(
|
||||
// backstretch settings from plugin/featured image settings
|
||||
$backstretch_settings = array(
|
||||
'src' => esc_url( $item->backstretch[0] ),
|
||||
'height' => esc_attr( $item->reduce ),
|
||||
) );
|
||||
);
|
||||
// backstretch settings which can be filtered
|
||||
$backstretch_variables = array(
|
||||
'centeredX' => true,
|
||||
'centeredY' => true,
|
||||
'fade' => 750,
|
||||
);
|
||||
|
||||
$backstretch_variables = apply_filters( 'display_featured_image_genesis_backstretch_variables', $backstretch_variables );
|
||||
$output = array_merge( $backstretch_settings, $backstretch_variables );
|
||||
|
||||
wp_localize_script( 'displayfeaturedimage-backstretch-set', 'BackStretchVars', $output );
|
||||
|
||||
if ( ! $keep_titles ) {
|
||||
if ( is_singular() && ! is_front_page() && ! is_page_template( 'page_blog.php' ) ) {
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
'use strict';
|
||||
|
||||
$( '.big-leader' ).css( { 'height': ( $(window).height() ) - ([BackStretchVars.height]) + 'px' });
|
||||
$( '.big-leader' ).backstretch( [BackStretchVars.src], { 'fade':750 } );
|
||||
$( '.big-leader' ).backstretch(
|
||||
[BackStretchVars.src], {
|
||||
centeredX: BackStretchVars.centeredX,
|
||||
centeredY: BackStretchVars.centeredY,
|
||||
fade: BackStretchVars.fade
|
||||
}
|
||||
);
|
||||
|
||||
})( this, jQuery );
|
||||
|
||||
Reference in New Issue
Block a user