Skip to content

Instantly share code, notes, and snippets.

View harrilehtisaari's full-sized avatar

harrilehtisaari

View GitHub Profile
function theme_mysql_queries () {
echo '<!-- ';
echo get_num_queries();
echo ' queries in ';
timer_stop(1);
echo ' seconds.-->';
}
add_action ( 'wp_footer','theme_mysql_queries', 999 );
add_action ( 'wp_after_admin_bar_render','theme_mysql_queries', 999 );
@harrilehtisaari
harrilehtisaari / gist:394d3ee57bc35eaf2548c738ab90ee98
Created August 27, 2016 12:04
Save ACF-fields in taxonomy terms as term_meta
/**
* Save all acf fields in terms as term meta (for easy query purposes [get_terms(meta_query)])
* Field names have to be prefixed with "meta_"
* URL: https://support.advancedcustomfields.com/forums/topic/how-to-use-wp-term-meta-on-acf-the-easy-way/
* Update term meta based on ACF term meta fields
*/
function namespace_acf_update_term_meta( $value, $post_id, $field ) {
$term_id = intval( filter_var( $post_id, FILTER_SANITIZE_NUMBER_INT ) );
if( substr( $field['name'], 0, 5 ) === 'meta_' ) {
### Custom
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias devel="cd ~/Sites/development"
alias killmem="killall memcached"
alias status="git status"
alias sattus="git status"
alias pull="git pull origin master"
alias editbash="subl ~/.bash_profile"
............................................................................................................................................
............................................................................................................................................
............................. . . . ....................................................................................
............................................................................................................................................
............................. . . . ....................................................................................
............................................................................................................................................
............................................................................................................................................
............................. ......
` -+``` `:yssyyyyyyyyyyyyho+/
mso. oM-sy ---++++hmysooooooooooooooooyo+++:--`
.ymNydMhd: -hssooooooooymdddmooohhhhdsooooooosyh/
+dMNsso `hooooooooooomhMMdhooomhmNydooooooosoom.