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
// Add link option to columns. | |
add_action( 'vc_after_init', function() { | |
vc_add_param( 'vc_column', array( | |
'type' => 'textfield', | |
'param_name' => 'link', | |
'heading' => esc_html__( 'Link', 'total'), | |
) ); | |
} ); | |
// Insert link into columns. |
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
class WPEX_Options_Panel { | |
/** | |
* Options panel arguments. | |
*/ | |
protected $args = []; | |
/** | |
* Options panel title. | |
*/ |
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() { | |
const button = document.querySelector( '.wpex-mobile-image-select' ); | |
const field = document.querySelector( '#wpex-mobile-image-input' ); | |
const onButtonClick = ( event ) => { | |
event.preventDefault(); | |
let send_attachment_bkp = wp.media.editor.send.attachment; | |
const currentImage = field.value; |
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
class WPEX_Mobile_Thumbnails { | |
/** | |
* Class constructor. | |
*/ | |
public function __construct() { | |
add_action( 'add_meta_boxes', [ $this, 'add_meta_box' ] ); | |
add_action( 'save_post', [ $this, 'save_meta_box' ] ); | |
add_filter( 'wp_get_attachment_image_attributes', [ $this, 'attachment_image_attributes' ], 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
/*** IMPORTANT ****/ | |
You need to make sure the AJAX script is loaded on the page which is done via PHP using the following: | |
<?php totalthemecore_call_non_static( 'Vcex\Ajax', 'enqueue_scripts' ); ?> | |
/**** SAMPLE FILTER HTML ****/ | |
@note: You can have multiple filter elements with the same target - for example if you want to have a search element that targets a filter above the grid and then the rest of the filter options to the side. |
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
// Open a new overlay wrapper around the main content and the footer. | |
add_action( 'wpex_hook_main_before', function() { | |
echo '<div class="myprefix-overlay-wrapper">'; | |
} ); | |
// Close overlay wrapper. | |
add_action( 'wpex_hook_wrap_bottom', function() { | |
echo '</div>'; | |
}, 999 ); |
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
add_action( 'vc_after_init', function() { | |
$elements = array( | |
// Remove core wpbakery elements | |
'vc_single_image', | |
// Remove total elements | |
'vcex_heading', | |
); | |
foreach ( $elements as $element ) { | |
if ( function_exists( 'vc_remove_element' ) ) { | |
vc_remove_element( $element ); |
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
// Exclude "red" term from related blog posts. | |
add_filter( 'wpex_blog_post_related_query_args', function( $args ) { | |
$exclude_terms = array( | |
'relation' => 'AND', | |
array( | |
'taxonomy' => 'category', | |
'field' => 'slug', | |
'terms' => array( 'red' ), | |
'operator' => 'NOT IN', |
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
add_filter( 'wpex_lightbox_settings', function( $settings ) { | |
$settings['video']['tpl'] = '<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}" loop> | |
<source src="{{src}}" type="{{format}}"> | |
Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player! | |
</video>'; | |
return $settings; | |
} ); |
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
add_action( 'wp_footer', function() { | |
wp_enqueue_script( 'jquery' ); | |
?> | |
<script> | |
document.addEventListener( 'click', function( event ) { | |
var target = event.target.closest( '.gallery-item a' ); |
NewerOlder