Skip to content

Instantly share code, notes, and snippets.

Joe Casabona jcasabona

Block or report user

Report or block jcasabona

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jcasabona
jcasabona / get-deferred.php
Last active Jul 8, 2019
WooCommerce URL Coupons - Get Deferred Coupons
View get-deferred.php
<?php
/** This function works with WooCommerce URL Coupons
* When a coupon gets deferred, it's added to a list of deferred_url_coupons.
* This function accepts a coupon ID ($coupon_id) as an argument, and gets all of the deferred_coupons
* as an array. The coupon ID would be an array key,which is what this function checks for.
* A message is printed. nothing is returned.
**/
function get_deferred_coupons( $coupon_id ) {
global $woocommerce;
@jcasabona
jcasabona / clean_google_docs.php
Created Dec 6, 2018
WordPress Filter to Clean Google Docs Markup on Post Save
View clean_google_docs.php
<?php
add_filter( 'content_save_pre', 'wpp_clean_google_docs' );
function wpp_clean_google_docs( $content ) {
if ( ! ( 'transcript' == get_post_type() ) ) {
return $content;
}
$search = array( '&nbsp;',
'</span>'
View error.js
Uncaught TypeError: Cannot read property 'prototype' of undefined
at n.modelId (load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,jquery-query,admin-comments,suggest,jquer&load[]=y-ui-sortable,postbox,jquery-ui-position,jquery-ui-menu,wp-a11y,jquery-ui-autocomplete,tags-suggest,tags-box,underscore,word-cou&load[]=nt,post,editor-expand,thickbox,shortcode,backbone,wp-util,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,me&load[]=dia-views,media-editor,media-audiovideo,mce-view,imgareaselect,image-edit,svg-painter,wp-auth-check,jquery-ui-resizable,wplink,m&load[]=edia-upload,wp-embed&ver=4.9.8:423)
at n.get (load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,jquery-query,admin-comments,suggest,jquer&load[]=y-ui-sortable,postbox,jquery-ui-position,jquery-ui-menu,wp-a11y,jquery-ui-autocomplete,tags-suggest,tags-box,underscore,word-cou&load[]=nt,post,editor-exp
@jcasabona
jcasabona / .json
Created Sep 5, 2018
VS Code User Preferences
View .json
{
"editor.fontSize": 15,
"terminal.integrated.fontSize": 18,
"editor.minimap.enabled": false,
"editor.fontFamily": "'Dank Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.wordWrap": "on",
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "'Dank Mono', 'Source Code Pro for Powerline'",
"workbench.colorTheme": "GitHub Plus",
"terminal.external.osxExec": "Hyper.app",
@jcasabona
jcasabona / refer-discount.php
Created Aug 14, 2018
Discount Referrer Pseudo Code
View refer-discount.php
<?php
add_action('woocommerce_before_cart_table', 'discount_frol_url');
function discount_from_url() {
global $woocommerce;
if( 'https://wpsessions.com' == wp_get_referer() ) {
$coupon_code = 'WPSESSIONS';
if (!$woocommerce->cart->add_discount( sanitize_text_field( $coupon_code ))) {
$woocommerce->show_messages();
}
View hover.scss
a {
@include card();
transition: all 1s ease;
@include breakpoint($bp-small, 'max') {
display: block;
margin: $margin-base;
}
&:hover,
View appendform.js
$(document).ready(function () {
var method;
method = method || 'POST';
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", '/');
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
@jcasabona
jcasabona / rethink.md
Last active Oct 18, 2016
Stuff for Rethink.FM
View rethink.md

Stuff for Rethink.FM

Bio

Joe Casabona is a Front End Developer that works in WordPress…a lot. In 2014, he authored a book called Responsive Design with WordPress, develops WordPress courses over at WP in One Month and has developed an accredited course on WordPress theming. He also hosts the How I Built It podcast.

Head Shot

https://www.dropbox.com/s/uu1l2v5mgl5j9m6/IMG_0081.jpg?dl=0

Show Notes

@jcasabona
jcasabona / functions.php
Created Sep 15, 2016 — forked from wpscholar/functions.php
Enqueueing IE conditional stylesheets in WordPress the right way
View functions.php
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@jcasabona
jcasabona / howibuit.md
Last active Sep 4, 2019
Guest Notes for How I Built It Podcast
View howibuit.md

Guest Notes for How I Built It Podcast

Tips for Good Recording

I'll be doing dual track recording, but if you could record audio on your side that would be great! That way if we see a dip in connection or get weird quality, I can do some track-layering action. To do that:

On a Mac

screenshot 2016-07-29 14 05 25

You can’t perform that action at this time.