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 | |
| /** | |
| * Reset the Cron Schedules for Paid Memberships Pro. | |
| * | |
| * 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 | |
| /** | |
| * 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] |
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 | |
| /** | |
| * Remove "Cancel" button for cancelled subscriptions. | |
| * | |
| * The user is still able to cancel auto-renew, but can't completely cancel the membership. | |
| */ | |
| add_filter( 'pmpro_member_action_links', function ( $pmpro_member_action_links ) { | |
| global $current_user; | |
| // bail if cancel link has been removed by someone else |
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 | |
| /** | |
| * Code for MAINWP DASH | |
| * Save information to the table {table_prefix}_mainwp_wp_options once the site is successfully synced | |
| * | |
| * @param mixed $pWebsite | |
| * @param array $information | |
| * | |
| * @return void |
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 | |
| /** | |
| * 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 |
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 | |
| if (!defined('ABSPATH')) exit; | |
| if (!class_exists('BVWPDynSync')) : | |
| class BVWPDynSync { | |
| public static $dynsync_table = 'dynamic_sync'; | |
| public $db; | |
| public $settings; |
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 | |
| /** | |
| * PayPal Express only: | |
| * Force pmpro_confirmed to be true in preheaders/checkout | |
| * this way the user will be always created, even if the | |
| * first payment was unsuccessful | |
| */ | |
| add_action( 'pmpro_checkout_confirmed', function ( $pmpro_confirmed, $morder ) { | |
| if ( ! empty( $morder ) && ! empty( $morder->gateway ) && 'paypalexpress' === $morder->gateway ) { |
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 | |
| /** | |
| * Pluck a certain field out of each object in a list. | |
| * | |
| * This has the same functionality and prototype of | |
| * array_column() (PHP 5.5) but also supports objects. | |
| * | |
| * @param array $list List of objects or arrays | |
| * @param int|string $field Field from the object to place instead of the entire object | |
| * @param int|string $index_key Optional. Field from the object to use as keys for the new array. |
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 | |
| // ... | |
| /* @var MemberOrder $last_order */ | |
| /* @var MemberOrder $old_order */ | |
| // Here we usually have $last_order or $old_order. | |
| // I think that using the last order is something that we will dismiss soon or later. | |
| // So I'm using $old_order later on. |
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 | |
| /** | |
| * Return all CSS class names for the specified element and allow custom class names to be used via filter. | |
| * | |
| * @since 2.3.4 | |
| * | |
| * @param string|string[] $class A string or array of element class names. | |
| * @param string $element The element to return class names for. | |
| * @param ...string $args Extra elements or contexts to be considered. | |
| * |