Skip to content

Instantly share code, notes, and snippets.

<?php
function register_ticket_coupon_shortcode( $shortcodes, EE_Shortcodes $lib ) {
if ( $lib instanceof EE_Ticket_Shortcodes ) {
$shortcodes['[COUPON_CODE]'] = _('This will output an S2member generated shortcode for non-member ticket purchasers.');
}
return $shortcodes;
}
add_filter( 'FHEE__EE_Shortcodes__shortcodes', 'register_ticket_coupon_shortcode', 10, 2 );
<?php
function register_vat_shortcode( $shortcodes, EE_Shortcodes $lib ) {
if ( $lib instanceof EE_Transaction_Shortcodes ) {
$shortcodes['[VAT_PAID]'] = _('This calculates 20% of the total price, to find out how much of what was paid is VAT.');
}
return $shortcodes;
}
add_filter( 'FHEE__EE_Shortcodes__shortcodes', 'register_vat_shortcode', 10, 2 );
{
"auto_complete": true,
"auto_indent": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Materialize/schemes/Material Solarized Dark.tmTheme",
"default_encoding": "UTF-8",
"detect_indentation": true,
"draw_indent_guides": true,
"draw_white_space": true,
<?php if (facetwp_display( 'facet', 'adaptation_levels' ) || facetwp_display( 'facet', 'search' )): ?>
<div class="category-navigation">
<div class="container vpadding--top vpadding--xs">
<div class="row">
<div class="col-xs-12">
<?php echo facetwp_display( 'facet', 'adaptation_levels' ); ?>
<?php echo facetwp_display( 'facet', 'search' ); ?>
</div>
<?php
// Doesn't work
$args = array(
'post_type' => 'espresso_events',
'meta_query' => array(
array(
'key' => 'is_this_an_external_event',
'value' => '1',
'compare' => '!='
),
<?php
function my_facetwp_is_main_query( $is_main_query, $query ) {
if ( isset( $query->query_vars['facetwp'] ) ) {
$is_main_query = true;
}
return $is_main_query;
}
add_filter( 'facetwp_is_main_query', 'my_facetwp_is_main_query', 10, 2 );
<?php $args = array(
'post_type' => 'espresso_events',
'posts_per_page' => -1,
'facetwp' => true
); ?>
<?php $the_query = new WP_Query( $args ); ?>
<?php if ( $the_query->have_posts() ) { ?>
<div class="facetwp-template">
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>