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 | |
| /* | |
| Plugin Name: UTF8mb4-convert | |
| Version: 1.0 | |
| */ | |
| function update_db_to_utf8mb4() { | |
| if ( ! isset( $_GET['update-utf8bm4'] ) ) { | |
| return; | |
| } |
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 | |
| // Adding this to get the form and entry object from Gravity Forms so I can test the connector. | |
| add_action('gform_after_submission', 'print_form_and_entry_object', 10, 2); | |
| function print_form_and_entry_object($entry, $form) { | |
| ob_start(); | |
| var_dump($entry); | |
| var_dump($form); | |
| $contents = ob_get_contents(); | |
| ob_end_clean(); |
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 | |
| /** | |
| * Place this code in your Customizations plugin, not including the opening php tag on line 1. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| /** | |
| * Create a menu to give us a place to perform the reset. I'm choosing a Dashboard menu purely for ease of access. | |
| */ | |
| add_action( 'admin_menu', 'core_reset_views_admin_page' ); | |
| function core_reset_views_admin_page() { |
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
| function filter_admin_menues() { | |
| // If administrator then do nothing | |
| if (current_user_can('activate_plugins')) return; | |
| // Remove main menus | |
| $main_menus_to_stay = array( | |
| // Dashboard | |
| 'index.php', |
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 | |
| /* | |
| * Wordpress postmeta find&replace code | |
| * | |
| * This file should be run on your source database to echo out update statements to run on your migrated database. | |
| * It is to address the issue of when doing a find/replace on an sql file during a wordpress migration, that breaks | |
| * any content changed within wordpress serialized meta values, particularly if you have custom post types etc. | |
| * | |
| * Do your normal find/replace over the exported sql, import it into your new database, then run this code and copy the resulting | |
| * update SQL into your new database to fix it. |
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 code assumes you already have custom roles created | |
| for bronzemember, silvermember, and goldmember. | |
| Members signing up for membership level #1 get "Bronze Member" role. | |
| Members signing up for membership level #2 get "Silver Member" role. | |
| Members signing up for membership level #3 get "Gold Member" role. | |
| Members cancelling are given the subscriber role. | |
| Admin users are ignored. | |
| */ |
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_action( "pmpro_after_change_membership_level", "e20r_cancel_at_end_of_period", 10, 2 ); | |
| add_filter( "pmpro_email_body", "e20r_email_body_for_cancel_msg", 10, 2 ); | |
| /** | |
| * Change cancellation to set expiration date for next payment instead of cancelling immediately. | |
| * Assumes monthly membership levels. | |
| * Assumes orders are generated for each payment (i.e. your webhooks/etc are setup correctly). | |
| * | |
| * @param (int) $level_id -- The membership levelId we're changing | |
| * @param (int) $user_id -- The member we're changing levels for. |
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
| /* | |
| Keep members start dates at checkout, even if switching levels. | |
| */ | |
| function custom_pmpro_checkout_start_date($date, $user_id, $level) | |
| { | |
| global $wpdb; | |
| // Comment this out if you want to use the users registration date (Warning: Registration date may not contain data...) | |
| $sqlQuery = "SELECT UNIX_TIMESTAMP(startdate) FROM $wpdb->pmpro_memberships_users WHERE user_id = '" . esc_sql($user_id) . "' ORDER BY id LIMIT 1"; | |
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 | |
| /* | |
| Plugin Name: PMPro Preserve Startdate | |
| Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/ | |
| Description: Customization to preserve initial membership signup (startdate) value. | |
| Version: 1.0 | |
| Author: Thomas Sjolshagen @ Stranger Studios <[email protected]> | |
| Author URI: https://eighty20results.com/thomas-sjolshagen/ | |
| */ | |
| /* |
NewerOlder