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 | |
/** | |
* Override a 404 | |
* | |
* @param string $template If passed, this template will be included and | |
* the request will be terminated if the inclusion | |
* was successful | |
* @param string $type If not a 404, what type of request should this be | |
* flagged as? Must correspond to one of the |
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
/** | |
* Image preloader | |
* | |
* @link http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript | |
*/ | |
var cache = []; | |
// Arguments are image paths relative to the current page. | |
function pilau_preload_images() { | |
var args_len, i, cache_image; | |
args_len = arguments.length; |
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 | |
/** | |
* Check if a WordPress page is "current", i.e. it's the current page or the ancestor of a current page | |
* | |
* @uses is_search() | |
* @uses get_post_type() | |
* @uses site_url() | |
* @uses get_permalink() | |
* @uses get_post_type_object() |
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
<?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 | |
/** | |
* Taxonomy list filters and columns | |
* | |
* @todo Test! | |
* @todo Need replacement function for slt_terms_list() | |
* @link http://wordpress.stackexchange.com/questions/578/adding-a-taxonomy-filter-to-admin-list-for-a-custom-post-type/3215#3215 | |
*/ | |
add_action( 'restrict_manage_posts', 'pilau_restrict_manage_posts' ); |
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
/* | |
* This is the bare minimum CSS necessary to make jQuery UI tabs "work". | |
* Obviously you'll need to do a lot more styling to make them "good" :) | |
*/ | |
.ui-tabs-hide { display: none; } |
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 | |
/** | |
* Skeletal sample shortcode | |
*/ | |
add_shortcode( 'pilau-sample', 'pilau_sample_shortcode' ); | |
function pilau_sample_shortcode( $atts ) { | |
extract( shortcode_atts( array( | |
'text' => '' | |
), $atts ) ); |
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 | |
/** | |
* Rename "Posts" to "News" | |
* | |
* @link http://new2wp.com/snippet/change-wordpress-posts-post-type-news/ | |
*/ | |
add_action( 'admin_menu', 'pilau_change_post_menu_label' ); | |
add_action( 'init', 'pilau_change_post_object_label' ); | |
function pilau_change_post_menu_label() { |
NewerOlder