Skip to content

Instantly share code, notes, and snippets.

View bordoni's full-sized avatar
:shipit:
Working on The Events Calendar

Gustavo Bordoni bordoni

:shipit:
Working on The Events Calendar
View GitHub Profile
<?php
add_filter( 'tribe_events_editor_default_template', function( $template ) {
$template_search = array_column( $template, 0 );
$organizer = array_search( 'tribe/event-organizer', $template_search );
unset( $template[ $organizer ] );
return $template;
}, 11, 1 );
<?php
/**
* Plugin Name: Modern Tribe: Prevent Assets Cache
* Plugin URI: https://theeventscalendar.com
* Description:
* Version: 0.1.0
* Author: Gustavo Bordoni
* Author URI: http://bordoni.me
* License: GPL-3.0+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
<?php
function tribe_support_ea_records_retention( $old ) {
return 5 * MINUTE_IN_SECONDS;
}
add_filter( 'tribe_aggregator_record_retention', 'tribe_support_ea_records_retention' );
<?php
// Add the following lines to your functions.php
function onlinenow_filter_purge_threshold () {
return 10;
}
add_filter( 'onlinenow-purge_threshold', 'onlinenow_filter_purge_threshold' );
@bordoni
bordoni / How To.md
Last active September 22, 2016 18:45
Vote Streamy Awards 100 times a day
@bordoni
bordoni / example-header.php
Created September 17, 2016 16:37
Online Now on The Header
<?php
$args = array(
// If Numeric is False, you can customize what shows up using this variable.
'plural' => __( '%s users online', 'online-now' ),
'singular' => __( 'One user online', 'online-now' ),
'zero' => __( 'Zero users online', 'online-now' ),
// If you want numeric, set this to True
'numeric' => false,
);
<?php
add_filter( 'manage_shop_order_posts_columns','remove_order_fields', 11 );
function remove_order_fields( $columns ) {
unset( $columns['order_notes'] );
unset( $columns['order_status'] );
unset( $columns['order'] );
return $columns;
}
# !sh
# Requires fswatch -- https://github.com/emcrisostomo/fswatch
# Usage
# wsync ~/wp-content/plugins ~/dev/tribe/*
# wsync $destination $from
function wsync {
# First Param as the the place where the files will go
to=$1
<?php
function __dev_filter_names( $i18n, $action, $post_type ) {
$i18n['delete'] = array(
Tribe__Events__Main::POSTTYPE => __( 'Remove a WordCamp', 'tribe-events-community' ),
Tribe__Events__Main::VENUE_POST_TYPE => __( 'Remove a Place', 'tribe-events-community' ),
Tribe__Events__Main::ORGANIZER_POST_TYPE => __( 'Remove a Contributor', 'tribe-events-community' ),
'unknown' => __( 'Unknown Post Type', 'tribe-events-community' ),
);
$i18n['default'] = array(
@bordoni
bordoni / wsync.sh
Last active October 25, 2015 15:06
# !sh
# Requires fswatch -- https://github.com/emcrisostomo/fswatch
# Usage
# wsync ~/wp-content/plugins ~/dev/tribe/*
# wsync $destination $from
function wsync {
# First Param as the the place where the files will go
to=$1