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 | |
/** | |
* How to filter the value that would be returned by get_post_thumbnail_id() | |
*/ | |
add_filter( 'get_post_metadata', function ( $value, $post_id, $meta_key, $single ) { | |
// We want to pass the actual _thumbnail_id into the filter, so requires recursion | |
static $is_recursing = false; | |
// Only filter if we're not recursing and if it is a post thumbnail ID |
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
{ | |
"id": "09bdc946-77fd-43a2-b9af-36ad57e54b57", | |
"assetName": "/storms/hurricane/video/water-rushes-through-building-in-dominican-republic", | |
"schema_version": "1.1.12", | |
"type": "video", | |
"locale": "en_US", | |
"title": "Watch: Matthew Sends Massive Storm Surge into Building", | |
"teaserTitle": "Watch: Matthew Sends Massive Storm Surge into Building", | |
"pcollid": "storms/hurricane", | |
"partnercolls": [], |
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_action( 'init', '\WPS\Plugins\Rewrite\PostTypeTaxonomy\register_cpt_resource' ); | |
/** | |
* Register the custom post type | |
* | |
* @since 1.2.0 | |
*/ | |
function register_cpt_resource() { | |
$labels = 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
;(function() { | |
var tag = document.createElement('script'); | |
tag.src = '//code.jquery.com/jquery.min.js'; | |
tag.type = 'text/javascript'; | |
tag.async = 'true'; | |
var hookTag = document.getElementsByTagName('head')[0]; | |
hookTag.appendChild(tag); | |
})(); |
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
git commit --allow-empty -m "Trigger notification" |
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
(function() { | |
let isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0, | |
// Chrome 1+ | |
isChrome = !!window.chrome && !!window.chrome.webstore; | |
console.log("isChrome: ", isChrome); | |
console.log("isOpera: ", isOpera); | |
function linkPreload(as, url) { | |
let l = document.createElement("link"); | |
l.rel = "preload"; |
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
# While I prefer to use brew for mostly everything | |
# SDKMan is a better manager for all things java/groovy | |
# Install and manage via sdkman | |
curl -s "https://get.sdkman.io" | bash | |
# Install a latest version of groovy | |
sdk install groovy | |
# Install a specific version of groovy, e.g., 2.4.9 | |
sdk install groovy 2.4.9 |
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 | |
/** | |
* Create the image attachment and return the new media upload id. | |
* | |
* @author Joshua David Nelson, [email protected] | |
* | |
* @since 03.29.2017 updated to a class, utilizing code from Takuro Hishikawa's gist linked below. | |
* | |
* @see https://gist.github.com/hissy/7352933 | |
* |
NewerOlder