Archives: Snippets
DIR SYNC 4
/** * Main LifterLMS Course Sync Engine * * PURPOSE: * – Syncs LifterLMS courses to llms_content_sync CPT * – Handles both automatic and manual synchronization * – Fires completion action for detail population extensions * – Cloudflare-safe with proper…Continue reading
DIR LIFTER SYNC 3
/** * LifterLMS Course Sync – Detail Population Module * * PURPOSE: * – Hooks into main sync completion * – Populates comprehensive course data (lessons, sections, quizzes, etc.) * – Populates ACF fields on llms_content_sync CPT * – Uses…Continue reading
Gravitar Fix
add_filter(‘get_avatar’, function($avatar_html, $id_or_email, $size) { // Force width/height attributes to match the requested avatar size $size = intval($size) ?: 26; // Remove existing width/height to avoid duplicates $avatar_html = preg_replace(‘/\s(width|height)=”\d+”/i’, ”, $avatar_html); // Add explicit width/height $avatar_html = preg_replace( ‘/]+)>/’,…Continue reading
Site Wide Header
add_filter(‘get_custom_logo’, function($html) { // Only touch the header logo return preg_replace( ‘/]+)>/’, ‘‘, // set to your display size $html, 1 ); });Continue reading
Site Wide Header
add_filter(‘get_custom_logo’, function($html) { // Only touch the header logo return preg_replace( ‘/]+)>/’, ‘‘, // set to your display size $html, 1 ); });Continue reading
frontend/js/snippets/scroll-behavior/sticky
… document.addEventListener(“DOMContentLoaded”, () => { // Customize this to match your sticky header (or set to null if not needed) const HEADER_SELECTOR = “#site-header”; const getHeaderOffset = () => { const header = HEADER_SELECTOR && document.querySelector(HEADER_SELECTOR); return header ? header.getBoundingClientRect().height…Continue reading
Remove “Coupon Field” on the Cart Page Amiru アミル さん
/** * Remove the “Have a coupon?” text and field from the cart page. Amiru アミル さん */ function woo_remove_coupon_form_on_cart() { remove_action( ‘woocommerce_before_cart_table’, ‘woocommerce_output_all_notices’, 10 ); remove_action( ‘woocommerce_cart_collaterals’, ‘woocommerce_cart_totals’, 10 ); } add_action( ‘woocommerce_cart_is_empty’, ‘woo_remove_coupon_form_on_cart’ ); remove_action( ‘woocommerce_cart_collaterals’, ‘woocommerce_form_coupon’, 10…Continue reading
Debloat your WooCommerce Tabs! Remove Default WooCommerce Tabs Amiru アミル さん
/** * Remove default WooCommerce product data tabs. Amiru アミル さん */ function woo_remove_product_tabs( $tabs ) { // Remove the Description tab unset( $tabs[‘description’] ); // Remove the Additional Information tab unset( $tabs[‘additional_information’] ); // Remove the Reviews tab unset(…Continue reading
Change the “Add to Cart” Button Text
/** * Change the “Add to Cart” button text globally. * Change ‘Buy Now’ to your desired text. */ function custom_woocommerce_product_add_to_cart_text( $text, $product ) { switch ( $product->get_type() ) { case ‘external’: return ‘View Product’; // Or ‘Buy from Vendor’…Continue reading