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
/** | |
* Make a custom permalink structure on top of a custom post type for yearly archives | |
* mapping the year to a meta field | |
*/ | |
/** | |
* Register a custom query variable in our example 'event_year' | |
* This can later be used in WP_Query like `get_query_var( 'event_year' )` |
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 | |
/** | |
* Modify ACF's WYSIWYG field toolbar | |
* @param array $toolbars toolbars | |
* @return array toolbars | |
*/ | |
function modify_acf_editor_toolbars( $toolbars ) { | |
$toolbars['Minimal' ] = array(); | |
$toolbars['Minimal' ][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 | |
/** | |
* Flush W3TC page cache when custom post types are updated. | |
*/ | |
function flushCustomPostTypesPageCache( $post_id ) { | |
$custom_post_types = array( | |
'post_type' => true | |
); |
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 | |
/** | |
* Temporary function: | |
* @return [type] [description] | |
*/ | |
function convert_to_legacy_posts() { | |
if( !is_admin() ) { | |
return; | |
} |
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://stackoverflow.com/a/10142256/2799523 | |
Array.prototype.shuffle = function() { | |
var i = this.length, j, temp; | |
if ( i == 0 ) return this; | |
while ( --i ) { | |
j = Math.floor( Math.random() * ( i + 1 ) ); | |
temp = this[i]; | |
this[i] = this[j]; | |
this[j] = temp; |
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
/** | |
* Get the total number of users by user role | |
* | |
* Usage: | |
* | |
* if( function_exists( 'get_resonate_user_count' ) ) { | |
* if( $count = get_resonate_user_count( 'my-custom-user-role' ) ) { | |
* echo sprintf( __( 'My user rule has %s users.' ), $count ); | |
* } | |
* } |
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
/** | |
* Extract the twitter user name from a twitter URL | |
* @param [type] $user_name [description] | |
* @return [type] [description] | |
*/ | |
public static function extract_username_from_url( $user_name ) { | |
// remove https://twitter.com/ | |
$user_name = str_replace( 'https://twitter.com/', '', $user_name ); | |
$user_name = str_replace( 'https://www.twitter.com/', '', $user_name ); |
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
var Sampler = ( function() { | |
var settings = { | |
samples: { | |
'808': { | |
0: 'bass.mp3' | |
} | |
}, | |
bpm: 110, | |
isPlaying: false, | |
isLoaded: false, |
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
// module pageTransitions | |
var pageTransitions = ( function() { | |
var settings = { | |
duration: 500, | |
selector: 'a[href^="' + globals.blogurl + '"]:not([data-page-transition="ignore"])' | |
}; | |
var init = function() { | |
$( 'html' ) |