// ✅ Add required capabilities to shop_manager_-_reseller_admin add_action(‘init’, function () { $role = get_role(‘shop_manager_-_reseller_admin’); if ($role) { $caps = [ ‘manage_product_terms’, ‘edit_roles’, ]; foreach ($caps as $cap) { if (!$role->has_cap($cap)) { $role->add_cap($cap); } } } }); // ✅ Add Categories…Continue reading
function set_default_user_role_customer($user_id) { $user = new WP_User($user_id); // Check if the user has no roles (which can happen in Multisite) if (empty($user->roles)) { $user->set_role(‘customer’); } } add_action(‘user_register’, ‘set_default_user_role_customer’); function remove_subscriber_role() { remove_role(‘subscriber’); } add_action(‘init’, ‘remove_subscriber_role’);Continue reading
/** * Sort Primary menu category items by post count (DESC). * Multisite-safe, cached, and preserves menu structure. */ if (!defined(‘ABSPATH’)) { exit; } // ———- Config ———- if (!defined(‘RW_PRIMARY_MENU_LOCATION’)) { define(‘RW_PRIMARY_MENU_LOCATION’, ‘primary’); // change if your theme uses a…Continue reading
if ( ! defined( ‘ABSPATH’ ) ) { exit; } add_action( ‘cli_init’, function () { if ( ! defined( ‘RD_FF_API_KLAVIYO_PRIVATE_KEY’ ) || ! RD_FF_API_KLAVIYO_PRIVATE_KEY ) { WP_CLI::error( ‘RD_FF_API_KLAVIYO_PRIVATE_KEY is not defined.’ ); } WP_CLI::add_command( ‘rd ff-klaviyo-backfill’, function ( $args, $assoc_args…Continue reading
/** * 2. Calculate the exact Stripe Fee (2.9% + .30) if “Yes” is selected */ add_filter( ‘charitable_get_donation_amount’, function( $amount, $data ) { if ( isset( $data[‘cover_fee_choice’] ) && ‘yes’ === $data[‘cover_fee_choice’] ) { // Reverse math formula: (Amount +…Continue reading
/** * 1. Register the Required Yes/No Radio Field */ add_action( ‘init’, function() { if ( ! class_exists( ‘Charitable_Donation_Field’ ) ) return; $field = new Charitable_Donation_Field( ‘cover_fee_choice’, array( ‘label’ => __( ‘Would you like your donation to cover third-party credit…Continue reading
/** * 1. Register the Required Yes/No Radio Field */ add_action( ‘init’, function() { if ( ! class_exists( ‘Charitable_Donation_Field’ ) ) return; $field = new Charitable_Donation_Field( ‘cover_fee_choice’, array( ‘label’ => __( ‘Would you like your donation to cover third-party credit…Continue reading
if ( ! defined( ‘ABSPATH’ ) ) { exit; } // Retrieve Klaviyo Private Key add_filter( ‘frm_api_request_args’, function ( $arg_array, $args ) { if ( ! defined( ‘RD_FF_API_KLAVIYO_PRIVATE_KEY’ ) || ! RD_FF_API_KLAVIYO_PRIVATE_KEY ) { return $arg_array; } if ( empty(…Continue reading
/** * ============================================================================= * VOELGOED — META CONVERSIONS API (CAPI) — PURCHASE (SERVER-SIDE) * ============================================================================= * – Captures fbp/fbc + IP + UA at checkout into order meta * – Sends Purchase via Conversions API when order is PAID (processing/completed)…Continue reading