This file contains hidden or 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
// Set slider template ID based on post type. | |
add_filter( 'get_post_metadata', function ( $value, $post_id, $meta_key, $single ) { | |
if ( $meta_key === 'slide_template' ) { | |
$post_type = get_post_type( $post_id ); | |
switch ( $post_type ) { | |
case 'post': | |
$value = 56; // change this to the template you want for this post type. | |
break; | |
case 'page': | |
$value = 56; // change this to the template you want for this post type. |
This file contains hidden or 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 | |
namespace WPExplorer\Avatars; | |
defined( 'ABSPATH' ) || exit; | |
class Self_Hosted { | |
public function __construct() { | |
add_filter( 'user_contactmethods', array( $this, 'add_option' ) ); | |
add_filter( 'pre_get_avatar', array( $this, 'alter_avatar' ), 1 , 3 ); |
This file contains hidden or 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
// Return array of CPT's that we want to add customizer panels for. | |
function my_cpts() { | |
return array( 'cars' ); | |
} | |
// Register new customizer panels. | |
add_filter( 'wpex_customizer_panels', function( $panels ) { | |
$cpts = my_cpts(); |
This file contains hidden or 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 | |
defined( 'ABSPATH' ) || exit; | |
if ( 'outside_link' !== $position ) { | |
return; | |
} | |
$taxonomy = wpex_get_post_primary_taxonomy(); // NOTE, if you know the taxonomy name you want to use, use that!! | |
$term_id = wpex_get_first_term_id( get_post(), $taxonomy ); |
This file contains hidden or 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
// Filter lightbox settings. | |
add_filter( 'wpex_lightbox_settings', function( $settings ) { | |
$settings['smallBtn'] = true; | |
return $settings; | |
} ); |
This file contains hidden or 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() { ?> | |
<script> | |
var checkboxes = document.getElementsByClassName( 'hh-toggle-next-disabled-button' ); | |
for (let i = 0; i < checkboxes.length; i++) { | |
hh_button_toggle( checkboxes[i] ); | |
} | |
function hh_button_toggle( checkbox ) { | |
var parent = checkbox.closest( '.wpb_raw_html' ) || checbox.closest( '.wpb_text_column' ); | |
var button = parent.nextElementSibling; |
This file contains hidden or 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
// Hook into the vc_shortcode_content_filter flter to modify the vc_column_text content | |
// and covert the more tag into an actual toggle button. | |
add_filter( 'vc_shortcode_content_filter', function( $content, $shortcode ) { | |
if ( 'vc_column_text' !== $shortcode ) { | |
return $content; | |
} | |
$is_inline = vc_is_inline(); | |
$needle = $is_inline ? '<!--more-->' : '<span id="more'; | |
$pattern = $is_inline ? '#<!--more-->#' : '#<span id=\"more-\d+\"><\/span>#'; |
This file contains hidden or 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
// Insert custom template after site header. | |
add_action( 'wpex_hook_header_after', function() { | |
echo do_shortcode( '[templatera id="15528"]' ); | |
} ); |
This file contains hidden or 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 wpex_add_custom_fonts() { | |
return array( 'Font 1', 'Font 2', 'Font 3', 'Font 4' ); | |
} |
This file contains hidden or 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 My_Class { | |
/** | |
* Our single My_Class instance. | |
* | |
* @var My_Class | |
*/ | |
private static $instance; | |
/** |