Skip to content

Instantly share code, notes, and snippets.

@cartpauj
cartpauj / memberpress-corporate-all-sub-accounts.php
Last active January 1, 2024 05:55
Get all sub-accounts for a parent user in MemberPress Corporate Accounts
<?php
$user = MeprUtils::get_currentuserinfo();
$sub_user_ids = array();
if($user !== false) {
$transactions = $user->active_product_subscriptions('transactions');
if(!empty($transactions)) {
foreach($transactions as $txn) {
if(($sub = $txn->subscription()) !== false) {
@jakebellacera
jakebellacera / floodlight-click-handler.js
Last active June 26, 2019 21:31
Floodlight click handler
document.getElementById("button").addEventListener("click", function(e) {
e.preventDefault();
var url = this.getAttribute("href", 2);
createFloodlightTag("source", "type", "cat", function() {
window.location = url; // Redirect the user after the tag successfully fires
});
});
function createFloodlightTag(source, type, cat, callback) {
@simonlk
simonlk / WooCommerce - related products from author
Created April 30, 2013 09:31
Replace the related products area with products by the same author