Skip to content

Instantly share code, notes, and snippets.

View thommeredith's full-sized avatar

Thom Meredith thommeredith

View GitHub Profile
@thommeredith
thommeredith / functions.php
Created June 8, 2017 18:33
Referral Candy WooCommerce Order Confirmation Popup
add_action( 'woocommerce_thankyou', 'refcandy_lollipop' );
function refcandy_lollipop( $order_id ) {
$order = wc_get_order( $order_id );
$divData = [
'id' => 'refcandy-lollipop',
'data-id' => 'USEYOURIDFROMYOURACCOUNT',
'data-fname' => $order->billing_first_name,
@thommeredith
thommeredith / wp_cli.php
Created July 7, 2017 23:01
wp cli custom post type remove post term
wp post list --post_type=program --fields=ID --format=csv | while read line ; do wp post term remove $line program_subjects connect ; done
@thommeredith
thommeredith / functions.php
Created November 20, 2017 23:04
Adds Bootstrap 3 Responsive wrap to oembed videos on Wordpress
add_filter( 'embed_oembed_html', function ( $html, $url, $attr ) {
if ((stripos($html,'<iframe') !== false || stripos($html,'<object') !== false || stripos($html,'<embed') !== false) && stripos($html,'flex-video') === false ) {
$html = str_replace("<iframe","<iframe class='embed-responsive-item'",$html);
return '<div class="embed-responsive embed-responsive-16by9">'.$html.'</div>';
} else {
return $html;
}
}, 9999, 3);
<section class="mrh-wrapper"
data-number-of-columns="3"
data-enable-pagination="true"
data-per-page="12"
data-theme="dark-theme"
data-information-displayed='["name","breed","gender","age","height"]'
data-button-types="solid-rectangular"
data-button-color="#0c02d8"
data-contact-button-label="Contact Us"
data-contact-email-address="{YOUR-EMAIL-ADDRESS}"
@thommeredith
thommeredith / gist:c219cc76230b102e104da2216a908271
Created August 15, 2020 00:26
find out php user for wordpress
echo(exec("whoami"));die();