This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function metaslider_filmstrip_alt_tags( $list_item, $post, $url ) { | |
$alt = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); | |
$list_item = "<li class=\"ms-thumb slide-{$post->ID} slide-{$post->ID}\" style=\"display: none;\"><img src=\"{$url}\" alt=\"{$alt}\" /></li>"; | |
return $list_item; | |
} | |
add_filter( 'metaslider_filmstrip_list_item', 'metaslider_filmstrip_alt_tags', 10, 3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function metaslider_add_custom_font_sizes_to_layer_editor($custom_sizes) { | |
// define fonts in the format of "Display Title/font size in em". Each font size seperated with a semi colon. | |
return "9/0.9em;25/3.5em;50/5em;100/10em;"; | |
} | |
add_filter('metaslider_layer_editor_font_sizes', 'metaslider_add_custom_font_sizes_to_layer_editor'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function metaslider_add_custom_colors_to_layer_editor($custom_colors) { | |
// define colors as hex codes (sans #), comma separated | |
return "FFFF00,00FFFF,FF0000"; | |
} | |
add_filter('metaslider_layer_editor_colors', 'metaslider_add_custom_colors_to_layer_editor'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_poster_to_video( $atts, $slide_id, $slider_id, $settings, $url ) { | |
$atts['poster'] = $url; | |
unset($atts['autoplay']); // stop video auto playing | |
return $atts; | |
} | |
add_filter('metaslider_layer_video_attributes','add_poster_to_video', 10, 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function metaslider_allow_svg( $is_valid, $slide ) { | |
if ( get_post_mime_type( $slide->ID ) == 'image/svg+xml' ) { | |
return true; | |
} | |
return $is_valid; | |
} | |
add_filter('metaslider_is_valid_image', 'metaslider_allow_svg', 10, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function metaslider_fix_zartis_jobs() { | |
if( isset( $_GET['page'] ) && $_GET['page'] == 'metaslider' ) { | |
wp_dequeue_script("zartis_functions"); | |
wp_dequeue_script("zartis_images"); | |
wp_dequeue_script("jquery_zar"); | |
} | |
} | |
add_action('admin_enqueue_scripts', 'metaslider_fix_zartis_jobs', 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function metaslider_add_data_media_attribute($attributes, $slide, $slider_id) { | |
$image = wp_get_attachment_image_src($slide['id'], 'full', false); | |
$attributes['data-pin-media'] = $image[0]; | |
return $attributes; | |
} | |
add_filter('metaslider_flex_slider_image_attributes', 'metaslider_add_data_media_attribute', 11,3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo do_shortcode("[metaslider id=254 restrict_to=home]"); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function metaslider_change_filmstrip_parameters($params, $slider_id, $settings) { | |
if ( $slider_id == XXX ) { // replace XXX with your slideshow ID | |
$params['itemMargin'] = 0; | |
$params['maxItems'] = 5; | |
$params['minItems'] = 5; | |
} | |
return $params; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function metaslider_fix_minimax() { | |
if(isset($_GET['page'])&&$_GET['page']=='metaslider') { | |
wp_dequeue_style("admin-theme-style"); | |
} | |
} | |
add_action('admin_enqueue_scripts', 'metaslider_fix_minimax', 10); |