View my_unescaped_pmpro_tos_content.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 | |
/** | |
* Update the TOS on the PMPro checkout page to skip the escaping | |
* introduced in PMPro 2.10. This will work in PMPro 2.10.1 or higher. | |
* | |
* You can add this code to your site using the Code Snippets plugin or by | |
* placing the code into a custom plugin or your theme's functions.php. | |
*/ | |
function my_unescaped_pmpro_tos_content( $content, $tospage ) { | |
return do_shortcode( $tospage->post_content ); |
View my_login_redirect.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 | |
/** | |
* Redirect all users to a very specific page on login. | |
* This should work no matter what login form/etc you are using. | |
* If it doesn't work, maybe the 999 priority needs to be higher. | |
* If you want to respect the redirect_to param or earlier callbacks | |
* that overwrite it, uncomment the section at the top of the function. | |
* | |
* You can add this code to your site using the Code Snippets plugin or by | |
* placing the code into a custom plugin or your theme's functions.php. |
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 my_pmprosp_minimum_password_score_message.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 | |
/** | |
* Swap or translate the password suggestions from the PMPro Strong Password Add On. | |
* These suggestions come from the bundled password strenght library. | |
* Until we update the plugin to make these translatable, | |
* the following code can be used to translate them on your site. | |
* | |
* 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 fix-charset-for-pmpro-tables.sql
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
# PMPro doesn't set the character set when creating its tables. | |
# So on install PMPro will use the default character set for your DB. | |
# In some cases this might be something like latin1, which will not | |
# work with special characters for non-latin languages, e.g. Hebrew. | |
# To fix this, you can update the character set on these tables using MySQL. | |
# | |
# IMPORTANT: Back up your DB (at least these tables) before running any queries. | |
ALTER TABLE wp_pmpro_membership_levels CONVERT TO CHARACTER SET utf8; | |
ALTER TABLE wp_pmpro_membership_levelmeta CONVERT TO CHARACTER SET utf8; | |
ALTER TABLE wp_pmpro_membership_ordermeta CONVERT TO CHARACTER SET utf8; |
View my_pmpro_additional_categories.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 | |
/** | |
* Require specific category user meta to view posts in designated categories. | |
* Custom price-adjusting fields are added via user fields. | |
* The initial payment and billing amount is adjusted based on cat selections. | |
* | |
* 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_email_custom_data.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 code will add user_id as a data variable for email templates in PMPro. | |
* | |
* 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/ | |
*/ | |
// begin copying code below here |
View PMPro_Membership_Level.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 | |
/** | |
* Some example code of how to create a PMPro membership level. | |
* Uses the PMPro_Membership_Level class and save() method. | |
*/ | |
// Copy a level. | |
$level = new PMPro_Membership_Level( 1 ); // Pass the ID of the level to copy. | |
$level->id = $level->ID = null; // Clear out the ID, triggers insert on save. | |
$level->name = 'NewName'; // Update any property you want. |
View non_featured_images_query.sql
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
SELECT p.ID | |
FROM wp_posts p | |
LEFT JOIN wp_postmeta pm ON p.ID = pm.post_id | |
AND pm.meta_key = '_thumbnail_id' | |
WHERE p.post_type = 'attachment' | |
AND post_status = 'publish' | |
AND pm.meta_id IS NULL; |
View add-billing-to-add-member-and-profile.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 | |
/* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* This will add billing fields to Add Member and the user's profile page. | |
*/ | |
function add_billing_fields_to_add_member_profile() { | |
//check for register helper | |
if(!function_exists("pmpro_add_user_field")) // pmprorh_add_registration_field | |
return; |
NewerOlder