View mypmpro-woo-discount-variable-pricing.php
This file contains 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 //do not copy | |
/** | |
* This recipe will either add a fee or discount to specific variations of a Woo | |
* product based on the level that the user holds. | |
* | |
* In the below example, variation ID 107 should have level 1 and a fee of 1500 will be added. | |
* Variation ID 108 requires a level 2 and applies a discount of 8 | |
* | |
* You can add this recipe to your site by creating a custom plugin |
View my_upload_size_limit_for_non_admins.php
This file contains 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 | |
/** | |
* Limit non-admin/editor file uploads to 2mb | |
* We check the upload_files capability, | |
* so anyone with access to the Media Library | |
* can upload files at the PHP/server set max. | |
* | |
* 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. |
View mypmpro-assign-membership-level-from-variable-product.php
This file contains 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 //do not copy | |
/** | |
* This recipe associates a membership level with a Variable product's variation. | |
* You can specify that Variation A should get Level 1 and Variation B should get Level 2. | |
* | |
* Add variations/levels to the array in Line 31 | |
* | |
* Use of this code recipe requires that the PMPro WooCommerce Add On is active. | |
* |
View buy-one-get-one-free-discount-easy-digital-downloads.php
This file contains 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 //do not copy | |
/** | |
* This code snippet checks if there's more than one item in the cart, | |
* finds the cheapest product and discounts it from the cart's total. | |
*/ | |
function buyone_getone_free_discount() { | |
$contents = edd_get_cart_contents(); |
View mypmpro-set-next-payment-date-expiration-date.php
This file contains 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 //do not copy | |
/** | |
* Gets the next payment date and marks that as the expiration date for users. | |
* | |
* The "next payment" value is an estimate based on the billing cycle of the subscription and the last order date. It may be off from the actual recurring date set at the gateway, especially if the subscription was updated at the gateway. | |
* | |
* Remove the // on line 40 to run the update query. | |
* | |
* You can add this recipe to your site by creating a custom plugin |
View add-billing-fields-to-user-profile-edit.php
This file contains 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 will add billing fields to the administrative user profile edit page for administrators | |
* and on the frontend PMPro user Edit Profile page for members. | |
* | |
* 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/ | |
*/ |
View my_pmpro_remove_subscription_delay_for_renewals.php
This file contains 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 subscription delay for existing/past members. | |
*/ | |
function my_pmpro_remove_subscription_delay_for_renewals() { | |
if ( is_admin() || ! is_user_logged_in() ) { | |
return; | |
} | |
$order = new MemberOrder(); |
View pmpro_block_dashboard-grant-certain-user-roles.php
This file contains 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 | |
/** | |
* Grant access to the back-end to certain user roles | |
* | |
* @param bool $prevent_admin_access | |
* | |
* @return bool | |
*/ | |
function pmpro_grant_admin_access_to_dataanalyst( $prevent_admin_access ) { | |
if ( current_user_can( 'dataanalyst' ) ) { |
View my_init_override_sponsored_members_pricing_update.php
This file contains 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 // do not copy this line. | |
/** | |
* Sponsored Members setup with child seat costs at checkout. | |
* SPONSOR SEAT + 4 seats 19.95 each | |
* + 5 to 19 @ 17.95 | |
* + 20 to 39 @ $15.95 | |
* + 40 to 79 @ 14.95 | |
* | |
* 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. |
View readonly-on-profile-page-registration-field.php
This file contains 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 | |
/** | |
* Readonly field on profile edit page. | |
* | |
* Add profile_readonly to field and set to true. | |
* | |
* Fields with this option will remain editable if the field is empty, or | |
* if the current user can manage options (administrators), or | |
* if the current user is a membership manager that have a | |
* membership manager role. |
NewerOlder