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_filter( | |
| 'wfea_availability_display', // filter hook name | |
| function ( $msg, $total_sold, $event_capacity ) { // annonyous function that takes 3 parameters - paramters are defined by the hook | |
| if ( $total_sold >= $event_capacity ) { | |
| $msg = __( 'Sold Out', 'widget-for-eventbrite-api' ); | |
| } else if ( ( $event_capacity - $total_sold ) > 10 ) { // set this number to what you like if you don't want a count | |
| $msg = 'Places Available'; | |
| } else { | |
| $msg = sprintf( '%1$s Places Left', ( $event_capacity - $total_sold ) ); | |
| } |
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
| jQuery(document).ready(function ($) { | |
| // as nothing will be on the page we initialise with a call | |
| ajax_call(); | |
| // on click of the search button we make the call with the filter value | |
| $('#ajaxwfeasearch').click(function () { | |
| ajax_call(); | |
| }); | |
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 | |
| /* | |
| Plugin Name: Test Ajax | |
| Plugin URI: https://fullworks.net | |
| Description: A demo of ajax calls to the Widget for Eventbrite plugin shortcode | |
| Version: 1.0 | |
| Author: Alan Fuller | |
| Author URI: https://fullworks.net | |
| License: GPL3 |
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
| <input type='text' id='ajaxwfeafilter'><button id='ajaxwfeasearch'>Search</button> | |
| <hr> | |
| <div id='ajaxwfea'></div> |
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
| ini_set('display_errors','Off'); | |
| ini_set('error_reporting', E_ALL ); | |
| define('WP_DEBUG', false); | |
| define('WP_DEBUG_DISPLAY', false); |
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 | |
| /** | |
| * Plugin Name: My Custom Code Snippets | |
| * Description: Change the description and version as needed | |
| * Version: 1.0 | |
| */ | |
| // just a check to make sure no hacker tries this file | |
| if ( ! defined('ABSPATH') ) { | |
| die(); | |
| } |
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 | |
| /** | |
| * Plugin Name: Custom Exceprt Filter | |
| * Description: Custom Excerpt Filter for Display Eventbrite | |
| * Version: 1.0 | |
| */ | |
| // just a check to make sure no hacker tries this file | |
| if ( ! defined('ABSPATH') ) { | |
| die(); | |
| } |
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_filter( ‘eawp_excerpt’, function($content) { | |
| return the_content(); | |
| }, 10,1); |
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 get_ip( $ipaddress = null ) { | |
| if ( ! empty( $ipaddress ) ) { | |
| if ( false === WP_Http::is_ip_address( $ipaddress ) ) { | |
| return '0.0.0.0'; | |
| } | |
| return $ipaddress; | |
| } | |
| $ipaddress = '0.0.0.0'; | |
| if ( getenv( 'HTTP_CF_CONNECTING_IP' ) ) { |
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 | |
| /* | |
| * Plugin Name: IPN Debug | |
| */ | |
| add_action( 'template_redirect', 'test_qem_ipn' ); | |
| function test_qem_ipn() { | |
| global $qem_fs; | |
| if ( ! isset ( $_GET['test_qem_ipn'] ) ) { | |
| return; |