Skip to content

Instantly share code, notes, and snippets.

View andrewlimaza's full-sized avatar

Andrew Lima andrewlimaza

View GitHub Profile
@strangerstudios
strangerstudios / pmpromyCRED.php
Last active July 9, 2021 22:56
Award MyCRED points for members who sign up for Membership Level 1.
<?php
/*
Use this recipe in combination with MyCRED to award points to members when signing up
for Level 1 membership. This code gist could be customized to give points for another
membership level ID, award recurring points for each subscription payment, and more.
MyCRED can be downloaded/configured here: https://wordpress.org/plugins/mycred/
*/
// Register Hook for PMPro Membership Points at Signup
@Spreeuw
Spreeuw / dokan-invoice-filters.php
Last active June 23, 2020 06:28
Dokan PDF Invoices
<?php
/*******************************
** DOKAN PDF INVOICE FILTERS **
*******************************/
/**
* Replace the main shop name with "Store Info" (actual shop name listed below)
*/
add_filter( 'wpo_wcpdf_shop_name', 'wpo_wcpdf_add_dokan_shop_name', 10, 1 );
function wpo_wcpdf_add_dokan_shop_name ( $shop_name ) {
@strangerstudios
strangerstudios / pmpro_register_redirect.php
Created November 14, 2014 21:44
Disable the PMPro redirect from default WordPress register page to PMPro levels page.
//add this line to your active theme's functions.php or a custom plugin
add_filter('pmpro_register_redirect', '__return_false');
@strangerstudios
strangerstudios / pmpro_clear_all_data_init.php
Last active July 22, 2023 09:43
Clear out all PMPro member and report data. (Back up your database first. For development use only. Use at your own risk!!!)
/*
Clear out all PMPro member and report data. (Back up your database first. Use at your own risk!!!)
This will delete all orders, members/level data, and reporting data.
Your levels, discount codes, and settings will remain in place.
All users will remain users (without memberships).
All subscriptions at the gateway will remain active.
To Use:
* Copy this code into your active theme's functions.php or a custom WP plugin.
* Navigate to /wp-admin/?pmprocleardata=1 when logged in as an admin.
@carlosleopoldo
carlosleopoldo / select-users.sql
Last active September 12, 2019 23:09
Select users in WordPress without specific user meta key and user id upper than...
-- Select users in WordPress without specific user meta key
-- * Replace meta_name for your meta key
-- * Replace > 0 for the minimum user ID
SELECT wp_users.ID
FROM wp_users
WHERE wp_users.ID > 0
AND wp_users.ID NOT IN (
SELECT DISTINCT user_id FROM wp_usermeta WHERE meta_key = 'meta_name'
)