Skip to content

Instantly share code, notes, and snippets.

@rickgregory
rickgregory / wccptxt.php
Created April 12, 2024 23:50 — forked from Acephalia/wccptxt.php
Change WC Coupon Placeholder
function my_coupon_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Coupon code' :
$translated_text = __( 'My New Coupon Code Text', 'woocommerce' ); // Change text here
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_coupon_strings', 10, 3 );
@rickgregory
rickgregory / functions.php
Created February 22, 2018 20:00 — forked from yratof/functions.php
ACF OEmbed with thumbnails
<?php
/* Pull apart OEmbed video link to get thumbnails out*/
function get_video_thumbnail_uri( $video_uri ) {
$thumbnail_uri = '';
// determine the type of video and the video id
$video = parse_video_uri( $video_uri );
// get youtube thumbnail
@rickgregory
rickgregory / blockerList.json
Last active September 1, 2015 06:42
Testing Safari Content Blocker on iMore.com
[
{
"action": {
"type": "block"
},
"trigger": {
"url-filter": ".*",
"resource-type": ["script"],
"load-type": ["third-party"],
"if-domain": ["*imore.com"]
@rickgregory
rickgregory / 0_reuse_code.js
Created December 23, 2013 05:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console