This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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' | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add this line to your active theme's functions.php or a custom plugin | |
add_filter('pmpro_register_redirect', '__return_false'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apachectl stop | |
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Make all fields (including transaction ids) editable on the orders page in the PMPro dashboard. | |
Add this code to a custom plugin. | |
*/ | |
function my_pmpro_orders_read_only_fields($fields) | |
{ | |
return array(); | |
} | |
add_filter('pmpro_orders_read_only_fields', 'my_pmpro_orders_read_only_fields'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Sometimes you have FTP access to a site, but don't have a WP administrator account. | |
You can use this code to create one. | |
1. Add this code into any plugin or theme file that you know will be run. | |
2. Visit /?createmyadministratoruser=1. | |
3. Delete the code you added. | |
*/ | |
function init_create_my_administrator_user() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Display messages of the Original Price, Discounted Price and Amount Saved when discount code is applied to PMPro order. | |
* Add this code recipe to a PMPro Customization Plugin - Display messages of the Original Price, Discounted Price and Amount Saved when discount code is applied to PMPro order | |
* Various classes added to strings to allow for styling - ".pmpro-discorig-message", ".pmpro-orginal-price", ".pmpro-discount-price", ".pmpro-save-price" | |
* | |
* [my_pmpro_applydiscountcode_return_js] Display original price and discount when a discount code is applied. | |
* @param string $discount_code [description] | |
* @param integer $discount_code_id [description] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Forward PMPro PayPal IPNs to another domain. | |
* Each domain will process the IPNs. The IPN handlers should be setup to ignore | |
* messages that aren't for that site. PMPro does this. | |
* This is useful if you have 2 different sites using the same PayPal account | |
* and the IPN is setup to go to a PMPro site. | |
* Add this to a custom plugin on the PMPro site the IPN hits. | |
* Update the domain/url to the IPN you want to forward to. | |
* The pmprodev_gateway_debug_setup check makes sure this DOESN'T run if you have the | |
* PMPro Toolkit plugin enabled, i.e. you are on a staging site. |
OlderNewer