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
$string = WPSEO_Meta::get_value( 'title', $post_id ); | |
if ( ! empty( $string ) { | |
$replacer = new WPSEO_Replace_Vars(); | |
return $replacer->replace( $string, get_post($post_id) ); | |
} |
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
// 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
<?php | |
/** | |
* Remove the slug from published post permalinks for our custom post types. | |
*/ | |
add_filter( 'post_type_link', function( $post_link, $post, $leavename ) { | |
$post_types = array( | |
'post_type_1', | |
'post_type_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
<?php | |
/** | |
* Modern Skin Class | |
* | |
* @package Total | |
* @subpackage Skins | |
* @author Alexander Clarke | |
* @copyright Copyright (c) 2014, Symple Workz LLC | |
* @link http://www.wpexplorer.com | |
*/ |
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 the overlay cart code for the overlay in the site footer | |
// Only needed if you don't have it enabled for the main menu | |
add_action( 'wp_footer', function() { | |
get_template_part( 'partials/cart/cart-overlay' ); | |
} ); | |
// Create new topbar_cart shortcode to be used as [topbar_cart] in the top bar content area (or anywhere really) | |
function my_cart_shortcode() { | |
// Needed functions |
NewerOlder