View example.php
This file contains 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 | |
function modify_woo_ticket_headers( $headers, $id ) { | |
remove_filter( 'woocommerce_email_headers', 'modify_woo_ticket_headers' ); | |
$organizer_email = tribe_get_organizer_email( $id, false ); | |
// add organizer email if it's a valid email address | |
if ( is_email( $organizer_email ) ) { | |
$headers[] = sprintf( 'Cc: %s', $organizer_email ); | |
} |
View array-insert-after.php
This file contains 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 | |
/** | |
* Insert a value or key/value pair after a specific key in an array. If key doesn't exist, value is appended | |
* to the end of the array. | |
* | |
* @param array $array | |
* @param string $key | |
* @param array $new | |
* |
View MySQL_zipcodes_within_radius.sql
This file contains 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
/* Given table 'zipcodes' with columns: | |
zipcode, latitude, longitude. | |
Find zipcodes within radius from given zipcode. | |
EXAMPLE: | |
Coordinates for zip 91326 and radius 25 mi: | |
*/ | |
SET @location_lat = 34.2766, | |
@location_lon = -118.544; | |
SELECT zipcode, ( 3959 * acos( cos( radians(@location_lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(@location_lon) ) + sin( radians(@location_lat) ) * sin( radians( latitude ) ) ) ) AS distance |
View export.sql
This file contains 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
/* | |
Intro: | |
Here are some export examples you can use to export Sabai directory data. I'm no MySQL expert and there's probably better ways to run these queries but this worked for my purposes. I hope this helps! | |
Note, this is going to export all columns and you'll need to manually go in and remove columns you don't need in Excel or Numbers or whatever spreadsheet program you have. | |
Usage: | |
This is meant to be run in phpMyAdmin. Look at your own table structure and modify as necessary for any custom fields, table prefix, and custom bundle. Custom fields are storedin their own tables and cross linked via entity_id which is the id of a listing. | |
*/ |
View imager-for-wp.php
This file contains 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 | |
/** | |
* Integrate Imager.js with WordPress | |
* | |
* Imager.js is BBC's solution for serving responsive and retina images, without | |
* the double payload issues that affect other solutions. For more information: | |
* | |
* https://github.com/BBC-News/Imager.js/ | |
* | |
* This collection of functions modifies the output of WordPress's |
View gw-gravity-forms-unrequire-required-fields-usage.php
This file contains 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 | |
# Basic Usage | |
# requires that the user be logged in as an administrator and that a 'gwunrequire' parameter be added to the query string | |
# http://youurl.com/your-form-page/?gwunrequire=1 | |
new GWUnrequire(); | |
# Enable for All Users (Including Visitors) | |
# still requires the 'gwunrequire' parameter be added to the query string | |
new GWUnrequire( array( |
View jquery.attrMatcher.js
This file contains 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
/** | |
* http://plnkr.co/edit/Mou8b94hzmuIVjd7b63w?p=preview | |
*/ | |
(function(global, factory) { | |
// CommonJS | |
if (typeof module === 'object') { | |
module.exports = factory(require('jquery')); | |
} else if (typeof global.define === 'function') { | |
// AMD | |
define(['jquery'], factory); |
View tribe-admin-events-list.class.php
This file contains 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 | |
/** | |
* update ~line 26 to include 2 argument params as such: | |
*/ | |
add_filter( 'posts_orderby', array( __CLASS__, 'events_search_orderby' ), 10, 2 ); | |
/** | |
* update static function `events_search_orderby` (replace with the following method starting at ~line 159) | |
*/ |
View gw-field-info-tab.php
This file contains 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 | |
/** | |
* Gravity Forms Field Info Tab | |
* http://gravitywiz.com | |
* | |
* Adds a summary of your fields as a tab on the form settings screen; includes field ID, label and field type. | |
* | |
*/ | |
class GWFieldInfo { | |
NewerOlder