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

One-Time Backfill for Existing Posts

add_action(‘init’, function () { if (!current_user_can(‘manage_options’) || !isset($_GET[‘run_related_organization_sync’])) return; $target_post_type = ‘post’; // e.g., ‘team’, ‘staff’, etc. $posts = get_posts([ ‘post_type’ => $target_post_type, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘fields’ => ‘ids’, ]); foreach ($posts as $post_id) { $external_ids_raw =…Continue reading