Skip to content

Instantly share code, notes, and snippets.

@thefrosty
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefrosty/4cc92703b5d2bc016901 to your computer and use it in GitHub Desktop.
Save thefrosty/4cc92703b5d2bc016901 to your computer and use it in GitHub Desktop.
Eventbrite Attendees Shortcode example filters for: https://wordpress.org/plugins/eventbrite-attendees-shortcode/
<?php
/**
* Plugin Name: Eventbrite Attendees Shortcode - Filters
* Plugin URI: https://gist.github.com/thefrosty/4cc92703b5d2bc016901
* Description: Example filters for the <a href="http://wordpress.org/plugins/eventbrite-attendees-shortcode/">Eventbrite Attendees Shortcode</a>. Made for Phillip D. @ laeventco.com
* Author: Austin Passy
* Author URI: http://austin.passy.co
* Version: 2014.10.28
* License: GPL
*/
class Eventbrite_Attendees_Shortcode_Filters {
var $make_clickable = array();
public function __construct() {
$this->make_clickable = array( 'company' );
add_filter( 'eventbrite_attendees_keys_to_unset', array( $this, 'eb_attendee_unset' ) );
foreach ( $this->make_clickable as $name ) {
add_filter( "eventbrite_attendees_{$name}_make_clickable", array( $this, 'eb_attendees_make_clickable' ) );
}
}
/**
* Removal all attendee keys exept for 'company' and 'website'
*
* @author Austin Passy <austin.passy.co>
* @siince 10/28/14
*/
function eb_attendee_unset( $data ) {
// If you want to remove additional info from the default
$newdata = array( 'display_name', 'first_name', 'last_name', 'email' );
$data = array_unique( array_merge( $newdata, $data ) );
return $data;
}
/**
* Make all global $make_clickable vars clickable.
*
* @author Austin Passy <austin.passy.co>
* @siince 10/28/14
*/
function eb_attendees_make_clickable() {
return true;
}
}
$Eventbrite_Attendees_Shortcode_Filters = new Eventbrite_Attendees_Shortcode_Filters;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment