Skip to content

Instantly share code, notes, and snippets.

View robertstaddon's full-sized avatar

Robert Staddon robertstaddon

View GitHub Profile
@robertstaddon
robertstaddon / gist:78cbcdf8de6fc7a6e264efbf5a320abb
Created October 28, 2020 20:31
divi_mobile_col_1_2_switch.css
/* Custom Divi Row Order .mobile_col_2_1 */
@media all and (max-width: 980px) {
.mobile_col_2_1 {
display: flex;
flex-wrap: wrap;
}
.mobile_col_2_1 .et_pb_column_1,
.mobile_col_2_1 .et_pb_column_1_2 {
order: 2;
@robertstaddon
robertstaddon / class-rcp-anet-payment-gateway.php snippet
Last active April 9, 2021 18:43
Restrict Content Pro Authorize.net Integration Handle Failed Payments
/**
* Subscription payment failed.
*
* 'payload' => array (
* 'name' => '', // Subscription name
* 'amount' => 00.00, // Subscription price
* 'status' => 'suspended', // Subscription status
* 'profile' => array (
* 'customerProfileId' => 123,
@robertstaddon
robertstaddon / functions.php
Created May 17, 2022 15:30
Remove Square Digital Wallet Payments for Smart Coupons Products that Autogenerate Coupons
add_filter( 'wc_square_digital_wallet_js_args', function ( $args ) {
if ( isset( WC()->cart ) && class_exists( 'WC_Smart_Coupons' ) ) {
$sc = WC_Smart_Coupons::get_instance();
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
$product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
$coupon_titles = $sc->get_coupon_titles( array( 'product_object' => $product ) );
if ( $coupon_titles ) {
$args['payment_request'] = array();
@robertstaddon
robertstaddon / functions.php
Last active October 30, 2022 05:44
Turn a WordPress Menu into a LiteSpeed ESI Block
<?php
add_filter( 'wp_nav_menu', function( $nav_menu_html, $args ) {
if ( $args->menu_id == "menu-id-to-replace" ) {
if ( apply_filters( 'litespeed_esi_status', false ) )
return apply_filters( 'litespeed_esi_url', 'my-esi-menu', 'Navigation Menu', array( 'nav_menu_html' => $nav_menu_html, 'args' => $args ), $control = 'private,no-vary', $silence = false );
}
return $nav_menu_html;
}, 10, 2);
@robertstaddon
robertstaddon / functions.php
Last active October 30, 2022 05:44
Turn Astra Secondary Menu into LiteSpeed ESI Block
<?php
add_filter( 'wp_nav_menu', function( $nav_menu_html, $args ) {
if ( $args->menu_id == "ast-hf-menu-2" ) {
if ( apply_filters( 'litespeed_esi_status', false ) )
return apply_filters( 'litespeed_esi_url', 'astra_secondary_menu', 'Secondary Menu', array( 'nav_menu_html' => $nav_menu_html, 'args' => $args ), $control = 'private,no-vary', $silence = false );
}
return $nav_menu_html;
}, 10, 2);