Untitled Snippet

function getChatContent() { const chat = document.querySelector(‘.mwai-chatbot .mwai-messages’) || document.querySelector(‘.mwai-chatbot’); return chat ? chat.innerHTML : ”; } function getChatText() { const chat = document.querySelector(‘.mwai-chatbot .mwai-messages’) || document.querySelector(‘.mwai-chatbot’); return chat ? chat.innerText : ”; } function buildPDFHtml(content) { return ` Your…Continue reading

Vimeo Autoplay Unmute (Homepage)

document.addEventListener(“click”, function () { const iframe = document.querySelector(“iframe[src*=’vimeo.com’]”); if (!iframe) return; iframe.contentWindow.postMessage( JSON.stringify({ method: “setVolume”, value: 1 }), “*” ); iframe.contentWindow.postMessage( JSON.stringify({ method: “play” }), “*” ); }, { once: true });Continue reading

Global profile keys (applies to all products)

/** * Initialize cross-cutting profile keys for ALL products. * Safe: only creates meta keys if missing. */ add_action( ‘save_post_product’, function( $post_id, $post, $update ) { if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) ) return; if ( ‘product’…Continue reading

Power meta (base + subcategory-specific)

/** * Initialize Power meta fields for Power category products. * Tiered like Speakers: base fields for all Power, plus subtree-specific fields. */ add_action( ‘save_post_product’, function( $post_id, $post, $update ) { if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id )…Continue reading

Yoast Breadcrumbs

add_action( ‘wp_head’, function() { if ( function_exists( ‘yoast_breadcrumb’ ) ) { echo ‘ ‘; yoast_breadcrumb( ‘ ‘, ‘ ‘ ); echo ‘ ‘; } });Continue reading

Hide Cart Price Button

/** * Hide Price & Add to Cart for Non Logged in Users for Specific Products */ function is_non_purchasable_products_for_visitors( $product ) { $not_purchasable_products = array( 23, 22 ); // Replace with Products ID you want to set as non purchasable…Continue reading

run on payment page

// This code runs every time the page is opened/reloaded $visits = 1; if (isset($_COOKIE[‘visits’])) { $visits = (int)$_COOKIE[‘visits’] + 1; } setcookie(‘visits’, $visits, time() + (86400 ), “/”); // Cookie lasts 1 days if ( ! defined( ‘EMAIL_SENT_PAGE_410’ )…Continue reading

CLI_Extension – Gravity Flow CLI Extension v2.0

/** * Gravity Flow CLI Extension v2.0 * * Verified against official Gravity Flow API documentation: * – Orchestration API: https://docs.gravityflow.io/the-workflow-orchestration-api/ * – Step Framework: https://docs.gravityflow.io/the-workflow-step-framework/ * – REST API v2: https://docs.gravityflow.io/the-workflow-web-rest-api/ * * INSTALLATION: * Place this file at:…Continue reading