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 | |
| /** | |
| * Redirect Administrators to WP Admin, | |
| * redirect all other users to the specified page after login. | |
| * | |
| * Ignores previously set redirects. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. |
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 | |
| /** | |
| * Cleanup script: Remove Basic User Avatars meta + files after PMPro migration. | |
| * Use the migration script first. | |
| * | |
| * Trigger from wp-admin URL: | |
| * - /wp-admin/?pmpro_avatar_cleanup=1&dry_run=1 (dry run) | |
| * - /wp-admin/?pmpro_avatar_cleanup=1&dry_run=0 (real cleanup) | |
| * | |
| * Check PHP error log for output. |
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 | |
| /** | |
| * Migration script: Basic User Avatars → PMPro Avatars | |
| * | |
| * To trigger, visit one of: | |
| * - /wp-admin/?pmpro_avatar_migrate=1&dry_run=1 (dry run) | |
| * - /wp-admin/?pmpro_avatar_migrate=1&dry_run=0 (real migration) | |
| * | |
| * Check PHP error log for progress output. | |
| * |
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 | |
| /** | |
| * This recipe assigns the readonly attribute to the fields | |
| * first_name, last_name, and date_de_naissance on profile edit pages | |
| * for non-admin users. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
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 | |
| /** | |
| * This recipe will take preference to discount codes. If a discount code is applied | |
| * and is free, the variable price field will be removed. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ |
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 | |
| /** | |
| * Script to locate, tag, export, then delete inactive users in your Paid Memberships Pro / WordPress website. | |
| * | |
| * Once this snippet is in the site, admins can run the process by visiting /?delete_inactive_users=1 in the WordPress admin. | |
| * Always back up user data before running any bulk delete script and remove this code after the process is done. | |
| */ | |
| function my_register_user_activity_taxonomy() { | |
| register_taxonomy( | |
| 'my_user_activity', |
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 | |
| /** | |
| * This recipe will check if a member has an active level associated with | |
| * their account. It will add either 'active' or 'inactive' to QR code's data. | |
| * | |
| * Set your shortcode to [pmpro_membership_card qr_code='true' qr_data='other'] | |
| * for this filter to take effect. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. |
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 Company Name as a bullet on the PMPro Invoice. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ |
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 | |
| /** | |
| * Bcc admin approval emails to users with pmpro_approvals capability. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function pmpro_approvals_bcc_admin_notification_emails( $headers, $email ) { |
NewerOlder