Untitled Snippet

const crypto = require(‘crypto’); const secret = ‘•••••••••’; // Your verification secret key const userId = current_user.id // A string UUID to identify your user const hash = crypto.createHmac(‘sha256’, secret).update(userId).digest(‘hex’);Continue reading

Add Product Listing Parameters to Google Product Feed

function lw_woocommerce_gpf_feed_item_google( $feed_item, $product ) { $feed_item->purchase_link .= ‘?utm_source=google&utm_medium=product_listing’; return $feed_item; } add_filter( ‘woocommerce_gpf_feed_item_google’, ‘lw_woocommerce_gpf_feed_item_google’, 10, 2 );Continue reading

DIRSYNC – Lifter Courses

/** * LifterLMS Content Sync Engine – Comprehensive Data Version * Syncs courses and lessons with ALL related content * WPCode Snippet – Run Everywhere – Priority 20 */ defined( ‘ABSPATH’ ) || exit; // Add manual sync button in…Continue reading

ACF – Lifter Course Directory

/** * LifterLMS Content ACF Fields – Comprehensive Version * Registers ACF fields for comprehensive LMS content synchronization * WPCode Snippet – Run Everywhere – Priority 10 */ defined( ‘ABSPATH’ ) || exit; add_action( ‘acf/init’, function () { if (…Continue reading

LIFTER COURSE CPT

/** * LifterLMS Content CPT Registration * Registers custom post type for LifterLMS course content synchronization * WPCode Snippet – Run Everywhere – Priority 0 */ defined( ‘ABSPATH’ ) || exit; add_action( ‘init’, function () { $labels = [ ‘name’…Continue reading

DIR Sync – Member Roles

/** * WordPress Roles Sync – Part 1: Button Only * WPCode Snippet – Run Everywhere – Priority 20 * Start with just this to test if it saves */ defined( ‘ABSPATH’ ) || exit; // Simple admin bar button…Continue reading

ACF – Member Roles

/** * Members Plugin Roles ACF Fields * Registers ACF fields for WordPress roles synchronization * WPCode Snippet – Run Everywhere – Priority 10 */ defined( ‘ABSPATH’ ) || exit; add_action( ‘acf/init’, function () { if ( ! function_exists( ‘acf_add_local_field_group’…Continue reading

CPT – Member Roles

/** * Members Plugin Roles CPT Registration * Registers custom post type for WordPress roles synchronization * WPCode Snippet – Run Everywhere – Priority 0 */ defined( ‘ABSPATH’ ) || exit; add_action( ‘init’, function () { $labels = [ ‘name’…Continue reading

Admin Privileges Being Returned

add_action(‘init’, function () { if (current_user_can(‘administrator’)) { $role = get_role(‘administrator’); if ($role) { // Capabilities related to editing pages, posts, and more $capabilities = [ ‘edit_posts’, ‘edit_others_posts’, ‘edit_published_posts’, ‘edit_pages’, ‘edit_others_pages’, ‘edit_published_pages’, ‘publish_posts’, ‘publish_pages’, ‘delete_posts’, ‘delete_others_posts’, ‘delete_published_posts’, ‘delete_pages’, ‘delete_others_pages’, ‘delete_published_pages’, ‘read’,…Continue reading