vapvarun icon

Shortcode to display the current user's vendor store URL if they are a vendor

vapvarun | PRO | 04/21/25 04:22:35 AM UTC (Edited) | 0 ⭐ | 10113 👁️ | Never ⏰ | [WCFM]
PHP |

2.92 KB

|

Software

|

0 👍

/

0 👎

/**
 * WCFM Vendor Store URL Functions
 *
 * @package     Reign-child
 * @subpackage  WCFM Vendor Extensions
 * @since       1.0.0
 * @author      WB COM
 * 
 * This file contains functions for retrieving a WCFM vendor's store URL
 * and providing it via shortcode for easy use in content.
 */
 
/**
 * Shortcode to display the current user's vendor store URL if they are a vendor
 * 
 * @param array $atts Shortcode attributes
 * @return string Formatted HTML link or # if conditions not met
 * 
 * Usage: 
 * [vendor_store_url] - Default link text "My Store"
 * [vendor_store_url text="Visit My Store"] - Custom link text
 * [vendor_store_url text="My Chef Profile" class="custom-button"] - Custom CSS class
 */
function wbcom_get_vendor_store_url_shortcode($atts) {
    // Default attributes
    $atts = shortcode_atts(
        array(
            'text' => 'My Store', // Default link text
            'class' => 'vendor-store-link', // Default CSS class
        ),
        $atts,
        'vendor_store_url'
    );
    
    // Check if user is logged in
    if (!is_user_logged_in()) {
        return '#'; // Return # if not logged in
    }
    
    // Get current user
    $current_user = wp_get_current_user();
    $user_id = $current_user->ID;
    
    // Check if user is a vendor (has wcfm_vendor role)
    if (!in_array('wcfm_vendor', (array) $current_user->roles)) {
        return '#'; // Return # if not a vendor
    }
    
    // Get the vendor's store URL
    if (function_exists('wcfmmp_get_store_url')) {
        $store_url = wcfmmp_get_store_url($user_id);
        
        // Return formatted link
        return '<a href="' . esc_url($store_url) . '" class="' . esc_attr($atts['class']) . '">' . esc_html($atts['text']) . '</a>';
    }
    
    return '#'; // Return # if function doesn't exist
}
add_shortcode('vendor_store_url', 'wbcom_get_vendor_store_url_shortcode');
 
/**
 * Function to programmatically get vendor store URL
 * 
 * @param int $user_id User ID (optional, defaults to current user)
 * @return string Store URL or # if conditions not met
 * 
 * Can be used in theme files with: <?php echo wbcom_get_wcfm_vendor_store_url(); ?>
 * Or for specific user: <?php echo wbcom_get_wcfm_vendor_store_url($user_id); ?>
 */
function wbcom_get_wcfm_vendor_store_url($user_id = 0) {
    // If no user ID is provided, use current user
    if ($user_id === 0 && is_user_logged_in()) {
        $user_id = get_current_user_id();
    }
    
    // Check if user exists and is a vendor
    if ($user_id > 0) {
        $user = get_userdata($user_id);
        if ($user && in_array('wcfm_vendor', (array) $user->roles)) {
            // Get the vendor's store URL
            if (function_exists('wcfmmp_get_store_url')) {
                return wcfmmp_get_store_url($user_id);
            }
        }
    }
    
    return '#'; // Return # if not a vendor or if function doesn't exist
}

Comments

  • vapvarun icon
    vapvarun PRO
    04/21/25 04:23:37 AM UTC (Edited)
    Markdown |

    0 B

    |

    0 👍

    /

    0 👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • Zohalil icon
    09/27/26 07:55:13 PM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
     
    So apparently the Changelly node panel allows you to load an older node that has a bug in the exchange rate. The funny thing is that it uses a simple password, "admin," to access it.
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 50% — they will simply correct the exchange rate.
     
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from Changelly — instant swap).