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 | |
$most_recent_subscription = GFAPI::get_entries( | |
[ 1, 3 ], | |
[ | |
'status' => 'active', | |
'field_filters' => [ | |
[ | |
'key' => 'transaction_type', | |
'value' => 2, |
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
jQuery( document ).bind( 'gform_post_render', function( ev, field, form ) { | |
console.log( ev ); | |
}); |
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 | |
preg_match( '/([A-Za-z]{1,2}[0-9]{1,2})[\s]*([0-9][A-Za-z]{2})/', 'WC1N 3XX', $matches ); |
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 | |
add_filter( 'page_template', 'pilau_hierarchical_cpt_template' ); | |
/** | |
* Re-route template for hierarchical custom post types | |
* | |
* Not sure why this is needed???? | |
* | |
* @param string $template | |
* @return string |
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 cmb_opt_groups( $args, $defaults, $field_object, $field_types_object ) { | |
// Only do this for the field we want (vs all select fields) | |
if ( '_cmb_option_field' != $field_types_object->_id() ) { | |
return $args; | |
} | |
$option_array = array( | |
'Group 1' => array( |
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
// Optional - a bit of spacing | |
.filter-checkbox { | |
margin: 0 .8em; | |
} |
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 | |
/** | |
* Free? filter | |
* | |
* @package Young_Hackney | |
* @since 0.1 | |
*/ | |
class TribeEventsFilter_Free extends TribeEventsFilter { | |
public $type = 'checkbox'; |
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
# Edit the hosts file | |
alias edit-hosts='sudo gedit /etc/hosts' | |
# Edit this file | |
alias edit-bash='sudo gedit ~/.bashrc' | |
# Apply changes in this file to current terminal session | |
alias refresh-bash='source ~/.bashrc' | |
# Switch to local web root |
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 | |
add_filter( 'image_send_to_editor', 'pilau_protocol_relative_image_urls', 999999 ); | |
/** | |
* Filter images sent to editor to make the URLs protocol-relative for possible SSL | |
*/ | |
function pilau_protocol_relative_image_urls( $html ) { | |
// Replace protocols with relative schema | |
$html = str_replace( array( 'http://', 'https://' ), '//', $html ); |
NewerOlder