Skip to content

Instantly share code, notes, and snippets.

View trishasalas's full-sized avatar

Trisha Salas trishasalas

  • Level Access
  • Tulsa, OK
View GitHub Profile
@trishasalas
trishasalas / tribe_filter-bar_custom_filter
Created September 30, 2018 03:43 — forked from rliverman/tribe_filter-bar_custom_filter
Add a custom filter to "The Events Calendar Pro" filter bar plugin based on a taxonomy
<?php
/**
* Adding a custom filter
* A simple copy and paste of the existing Category filter
* Find this new filter in: WP Admin > Events > Settings > Filterbar
* Docs for TribeEventsFilter: http://docs.tri.be/Filter-Bar/class-TribeEventsFilter.html
*/
class TribeEventsFilter_CustomClubs extends TribeEventsFilter {
public $type = 'select';
<?php
/**
* Plugin Name: Dev Plugins
*/
add_action( 'muplugins_loaded', function() {
// Plugins to activate automatically.
$auto_activate = [
'debug-bar/debug-bar.php',
'debug-bar-extender/debug-bar-extender.php',
<div class="small-12 medium-6 large-4 columns">
<?php
$events = tribe_get_events(
array(
'posts_per_page' => 1,
'orderby' => 'meta_value',
'order' => 'DESC',
) );
foreach ( $events as $event ) {
<?php
/**
* Removes the word "Free" when cost is 0 or event is RSVP
*
* Event Tickets Plus
* @author Trisha Salas
*
* @param $cost
*
* @return string
function tribe_custom_loop() {
$events = tribe_get_events (
array (
'posts_per_page' => 5,
'start_date' => date( 'Y-m-d H:i:s' )
) );
foreach ( $events as $event ) {
$sdate = tribe_get_start_date( $event, false, 'M j' );
//$elink = tribe_get_event_link( $event );
@trishasalas
trishasalas / custom-list-view-widget.php
Created April 21, 2017 00:51
These functions should be used in conjunction with the list view widget in Events Calendar PRO
function tribe_upcoming_events() {
$front_page_sidebar = get_post_meta( get_the_ID(), 'tribe_events', true );
if ( ! is_active_sidebar( $front_page_sidebar ) ) {
return;
}
add_action( 'tribe_events_list_widget_after_the_event_title', 'tribe_event_start_date' );
echo '<div class="events"><div class="events-content">';
add_action( 'tribe_events_list_widget_before_the_event_title', 'tribe_get_events_featured_image' );
add_action( 'tribe_events_list_widget_after_the_meta', 'tribe_get_venue_details' );
dynamic_sidebar( $front_page_sidebar );
@trishasalas
trishasalas / next-post.php
Last active April 14, 2017 05:21
For The Events Calendar: Gets the post object for the next event when called from 'single-event.php'
<?php
/**
* Gets the post object for the next event when called from 'single-event.php'
*
*/
$start_date = get_post_meta( get_the_ID(), '_EventStartDate', true );
$args = array(
'post__not_in' => array( get_the_ID() ),
@trishasalas
trishasalas / events-conditional-wrappers.php
Created April 14, 2017 02:49 — forked from jo-snips/events-conditional-wrappers.php
The Events Calendar: Basic Conditional Wrappers
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
.screen-reader-text {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
position: absolute !important;
width: 1px;
@trishasalas
trishasalas / gist:83015d849a42a230bc3e520ee636bf0e
Created July 14, 2016 02:59 — forked from lloc/gist:5685040
WordPress - Add link to plugin_row_meta
<?php
define( 'PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
function my_plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
if ( PLUGIN_BASENAME == $plugin_file )
$plugin_meta[] = '<a href="#">Test: plugin_row_meta</a>';
return $plugin_meta;
}
add_filter( 'plugin_row_meta', 'my_plugin_row_meta', 10, 4 );