This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
/** | |
* This gist is for Javascript beginners. | |
* @author: Anthony Du Pont <[email protected]> | |
* @site: https://www.twitter.com/JsGists | |
* | |
* The `Math.random()` method only return a random number between 0 and 1. | |
* But what if you want a larger range than [0, 1] ? We need to improve this | |
* random method. | |
* | |
* Example: |
/** | |
* This gist is for Javascript beginners. | |
* @author: Anthony Du Pont <[email protected]> | |
* @site: https://www.twitter.com/JsGists | |
* | |
* Methods like `querySelectorAll()` are handy to select multiple DOM elements at once. | |
* But these methods return a `NodeList` which is a list of all the matching DOM elements. | |
* No problem at first glance but when you dig a little bit you'll notice there are some | |
* issues when you want to manipulate them. | |
* |
<?php | |
add_action( 'wp_insert_post', 'willy_set_default_term', 10, 3 ); | |
function willy_set_default_term( $post_id, $post, $update ) { | |
if ( 'cpt' == $post->post_type ) { // replace `cpt` with your custom post type slug | |
/** | |
* Replace `taxo` by the taxonomy slug you want to control/set | |
* … and replace `default-term` by the default term slug (or name) | |
* (or you can use a `get_option( 'my-default-term', 'default term' )` option instead, which is much better) | |
*/ | |
if ( empty( wp_get_post_terms( $post_id, 'taxo' ) ) ) { |
// Add on element with overflow | |
-webkit-mask-image: -webkit-radial-gradient(white, black); |
<?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 | |
* |
This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
/*! | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2016 by Blake Bowen (http://codepen.io/osublake/pen/OyPGEo) | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
/** | |
* | |
* Filter Yoast SEO Metabox Priority | |
* @author Jacob Wise | |
* @link http://swellfire.com/code/filter-yoast-seo-metabox-priority | |
* | |
*/ | |
add_filter( 'wpseo_metabox_prio', 'jw_filter_yoast_seo_metabox' ); | |
function jw_filter_yoast_seo_metabox() { | |
return 'high'; |
(function ($) { | |
$.fn.uncheckableRadio = function () { | |
return this.each(function () { | |
var radio = this, | |
label = $('label[for="' + radio.id + '"]'); | |
if (label.length === 0) { | |
label = $(radio).closest("label"); | |
} | |
var label_radio = label.add(radio); | |
label_radio.mousedown(function () { |