Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇸
We will rebuild, reconcile and recover.

Luke Cavanagh lukecav

🇺🇸
We will rebuild, reconcile and recover.
View GitHub Profile
@lukecav
lukecav / Custom DB table
Created May 19, 2020
WooCommerce Square plugin created custom database table
View Custom DB table
wp_woocommerce_square_customers
@lukecav
lukecav / functions.php
Created May 18, 2020
Jetpack Site Accelerator (Photon) ignore using HTTPS for images and assets
View functions.php
add_filter( 'jetpack_photon_reject_https', '__return_true' );
@lukecav
lukecav / functions.php
Created May 16, 2020
Enable Jetpack Site Accelerator Development Mode
View functions.php
add_filter( 'jetpack_photon_development_mode', '__return_true' );
@lukecav
lukecav / Postmeta info
Created May 15, 2020
LearnDash WooCommerce Orders and course post type meta (sfwd-courses)
View Postmeta info
WooCommerce orders meta
_learndash_plus
Custom fields on course
course_access_list
@lukecav
lukecav / functions.php
Created May 14, 2020
WooCommerce Helper Supress Admin Notices
View functions.php
add_filter( 'woocommerce_helper_suppress_admin_notices', '__return_true' );
@lukecav
lukecav / wp-config.php
Created May 11, 2020
Disable LifterLMS REST API in WordPress
View wp-config.php
define( 'LLMS_REST_DISABLE', true );
@lukecav
lukecav / wp-config.php
Created May 11, 2020
Disable LifterLMS from using WP Session Manager
View wp-config.php
define( 'LLMS_USE_PHP_SESSIONS', true );
@lukecav
lukecav / media-regen-wpmdb-migration-complete.php
Created May 11, 2020
Regenerate media using a WP-CLI command once a WP Migrate DB Pro migration is complete
View media-regen-wpmdb-migration-complete.php
add_action( 'wpmdb_migration_complete', 'regen_media_migration_complete', 2, 20 );
function regen_media_migration_complete ( $action, $url ) {
$wp = "/chroot/home/a80f149d/no-install.com/html"; //full path to the WP-CLI command
global $wp_current_filter;
$is_remote = strstr($wp_current_filter[0], 'nopriv') ? true : false;
if ( ( 'push' == $action && $is_remote ) ||
( 'pull' == $action && ! $is_remote ) )
{
exec( "$wp media regenerate --yes /dev/null 2>/dev/null &" );
}
@lukecav
lukecav / functions.php
Created May 11, 2020
Exclude resized media in a WP Migrate DB Pro sync
View functions.php
add_filter( 'wpmdb_exclude_resized_media', '__return_true' );
@lukecav
lukecav / Link
Created May 11, 2020
Restoring original visitor IPs - Option 2: Installing mod_remoteip with Apache
View Link