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 | |
add_action( 'tgmsp_callback_start', 'tgm_soliloquy_remove_image_attr' ); | |
function tgm_soliloquy_remove_image_attr( $id ) { | |
$script = 'var slides = $(slider).find(".soliloquy-slides > li img");'; | |
$script .= '$(slides).each(function(i){'; | |
$script .= '$(this).removeAttr("width height");'; | |
$script .= '});'; | |
echo $script; | |
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 | |
add_action( 'soliloquy_api_on_load', 'tgm_soliloquy_autoplay_vimeo_on_load' ); | |
function tgm_soliloquy_autoplay_vimeo_on_load( $data ) { | |
ob_start(); | |
?> | |
var slide_video = soliloquy_<?php echo $data['id']; ?>.find('.soliloquy-item:not(.soliloquy-clone):eq(' + currentIndex + ') .soliloquy-video-icon'); | |
if ( slide_video.length > 0 ) { | |
var video_type = slide_video.data('soliloquy-video-type'); | |
if ( 'vimeo' == video_type ) { |
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 | |
add_filter( 'envira_gallery_output_after_link', 'tgm_envira_gallery_caption', 10, 5 ); | |
/** | |
* Adds a caption below each image in the gallery. | |
* | |
* @since 1.0.0 | |
* | |
* @param string $output String of gallery output. | |
* @param mixed $id The ID of the gallery. | |
* @param array $item Array of data about the image. |
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 | |
add_filter( 'tgmsp_caption_output', 'tgm_soliloquy_link_caption', 10, 3 ); | |
function tgm_soliloquy_link_caption( $caption, $id, $image ) { | |
if ( empty( $image['link'] ) ) { | |
return $caption; | |
} | |
$linked_caption = '<a href="' . esc_url( $image['link'] ) . '" title="' . esc_attr( $image['title'] ) . '">' . $caption . '</a>'; | |
return $linked_caption; |
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 | |
add_action( 'after_setup_theme', 'tgm_soliloquy_remove_post_type' ); | |
function tgm_soliloquy_remove_post_type() { | |
if ( ! class_exists( 'Soliloquy' ) ) { | |
return; | |
} | |
add_filter( 'soliloquy_post_type_args', '__return_empty_array' ); |
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 | |
add_action( 'add_meta_boxes', 'tgm_soliloquy_remove_metabox', 0 ); | |
function tgm_soliloquy_remove_metabox() { | |
if ( ! class_exists( 'Soliloquy' ) ) { | |
return; | |
} | |
if ( empty( get_current_screen()->post_type ) || 'soliloquyv2' == get_current_screen()->post_type ) { | |
return; |
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
jQuery(document).ready(function($){ | |
$(document).on('click', '.manual-optin-trigger', function(e){ | |
e.preventDefault(); | |
var $this = $(this); | |
// Ensure that the OptinMonster function exists. | |
if ( typeof window['OptinMonster'] === 'function' ) { | |
// Load a different optin based on ID. | |
if ( 'your-id-here' == $this.attr('id') ) { | |
// Append our holder to the DOM if it does not already exist. |
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 | |
if ( ! defined( 'OPTINMONSTER_REPORTING' ) ) { | |
define( 'OPTINMONSTER_REPORTING', true ); | |
} |
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 | |
add_filter( 'soliloquy_image_output_attr', 'tgm_soliloquy_prevent_pin' ); | |
function tgm_soliloquy_prevent_pin( $attr ) { | |
return $attr . ' data-pin-no-hover="true"'; | |
} |
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 | |
add_filter( 'tgmsp_image_output', 'tgm_soliloquy_prevent_pin', 10, 5 ); | |
function tgm_soliloquy_prevent_pin( $html, $id, $image, $alt, $title ) { | |
return '<img class="soliloquy-item-image" src="' . esc_url( $image['src'] ) . '" alt="' . esc_attr( $alt ) . '" title="' . esc_attr( $title ) . '" data-pin-no-hover="true" />'; | |
} |