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 bbloomer_add_gift_if_sku_added_cart( $passed, $product_id, $quantity ) { | |
global $woocommerce; | |
$skuswithgift = array('SMWB-M23','001-SLW'); | |
$giftsku = 'comb'; | |
$coupon_code = 'combfree'; |
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 | |
// ex: | |
// With [time since="1997"] years experience | |
// outputs: With 20 years of experience | |
class SCCTimeShortcode { | |
static $add_script; | |
static function init() { |
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 | |
// https://deliciousbrains.com/wordpress-security-fundamentals/ | |
// Remove the WordPress version from the <head> tag | |
add_filter( 'the_generator', '__return_empty_string' ); | |
// wp-config.php |
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
.fb_dialog, | |
.fb_dialog.fb_dialog_advanced.fb_shrink_active, | |
.fb_iframe_widget iframe, | |
.fb_dialog_content iframe { | |
left: 18pt; | |
} |
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
// Requires ES6 | |
import moment from 'moment' | |
makeHumanDate (jsDateObject) { | |
// Now (If less than 1 minute) | |
// 5 mins ago (If less than 1 hours) | |
// 19 hrs ago (If less than 24 hours) | |
// Yesterday (If date is yesterday) | |
// Sunday (If from this week) |
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
.fb_dialog, | |
.fb_dialog.fb_dialog_advanced.fb_shrink_active, | |
.fb_iframe_widget iframe, | |
.fb_dialog_content iframe { | |
display: none; | |
} |
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 | |
/** | |
* Get a users first name from the full name | |
* or return the full name if first name cannot be found | |
* e.g. | |
* James Smith -> James | |
* James C. Smith -> James | |
* Mr James Smith -> James | |
* Mr Smith -> Mr Smith |
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
// Cropping towards a focal point | |
/* | |
This controls where the image is cropped toward as | |
the design flows around it responsively. | |
This would be the same as a focal point in photography. | |
Original Idea: https://designshack.net/articles/mobile/focal-point-intelligent-cropping-of-responsive-images/ | |
*/ |
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
/* | |
This a helper for adding Facebook's Javascript SDK in a modern development environment with build tools. | |
Runs as a promise so you can run: | |
await const FB = facebook() | |
OR | |
facebook().then((FB) => { | |
}) | |
and then know that your facebook SDK is initialized | |
It also should work with fullstack frameworks like Next.js and Nuxt.js |
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
/* | |
* Just add vc_reverse-rows to the classes of what you want to reverse | |
*/ | |
.vc_reverse-rows .col { | |
flex-direction: row-reverse; | |
} |