Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 14:22 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / remove_confirm_email.php
Last active February 23, 2024 13:27 — forked from kimwhite/remove_confirm_email_password.php
Remove the "Confirm Email" field on checkout page
<?php
/**
* This recipe will remove the "Confirm Email" field on checkout
*
* 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/
*/
@dwanjuki
dwanjuki / gettext-multiple-memberships-per-user-with-context.php
Last active February 19, 2024 09:50 — forked from kimwhite/gettext-multiple-memberships-per-user.php
Change or translate text strings for PMPro Multiple Memberships Per User.
<?php
/**
* Change or translate text strings for PMPro Multiple Memberships Per User.
*
* This recipe assumes and requires that both PMPro core and PMPro Multiple Memberships Per User are active.
*
* 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/
@dwanjuki
dwanjuki / period_to_lock_member_only_content_per_membership_level.php
Created February 12, 2024 15:02 — forked from ipokkel/period_to_lock_member_only_content_per_membership_level.php
Lock membership content for an additional period. This is handy for memberships that should have access to a members-only post after a certain time has passed depending on their level. E.g. Gold level has immediate access, silver has access after 7 days and bronze after one month the post was published.
<?php
/**
* Set a waiting period before unlocking a members-only post that
* the member's membership level has access to.
*
* To set which posts to unlock and their individual period (days)
* set the post id's as the array key and the period as the
* value of the array key of the $posts_to_unlock variable.
*
* You can add this recipe to your site by creating a custom plugin
@dwanjuki
dwanjuki / pmpro-signup-shortcode-gettext-.php
Last active February 5, 2024 11:50 — forked from ipokkel/pmpro-signup-shortcode-gettext-example.php
Translate or change a text string in the PMPro Signup Shortcode
<?php
/**
* Translate or change a text string in the PMPro Signup Shortcode.
*
* 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 my_pmpro_signup_shortcode_gettext( $translated, $text, $domain ) {
@dwanjuki
dwanjuki / mypmpromm-remove-map-directory-pages.php
Last active January 25, 2024 13:47 — forked from JarrydLong/mypmpromm-remove-map-directory-pages.php
This recipe will remove the map from the directory page when using the Membership Directory Add On
<?php
/**
* This recipe will remove the map from the directory page
* when using the Membership Directory Add On
*
* 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/
*/
@dwanjuki
dwanjuki / get_user_metadata_pmpro_prepop.php
Last active December 14, 2023 14:19 — forked from strangerstudios/get_user_metadata_pmpro_prepop.php
Default some PMPro fields based on other user meta.
<?php // copy from below
/**
* Synchronize WooCommerce Billing Address and PMPro Billing Address
*
* 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 get_user_metadata_pmpro_prepop($value, $user_id, $meta_key, $single) {
@dwanjuki
dwanjuki / my-pmpro-adjust-trial-ending-email.php
Last active November 21, 2023 14:25 — forked from andrewlimaza/my-pmpro-adjust-trial-ending-email.php
Adjust trial ending email to be closer to the time [Paid Memberships Pro]
<?php
/**
* Send trial ending soon emails 3 days before trial ends.
* Add this code to your Code Snippet/Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_adjust_trial_ending_email( $days ) {
return 3;
}
add_filter( 'pmpro_email_days_before_trial_end', 'my_pmpro_adjust_trial_ending_email', 10, 1 );
@dwanjuki
dwanjuki / pmpro-show-password-toggle-reset-password.php
Last active November 13, 2023 09:08 — forked from ipokkel/pmpro-show-password-toggle-reset-password.php
Show passwords on the Member Profile reset password page.
<?php // copy from below here
/**
* Password visibility toggle on the Member Profile reset password page.
*
* 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 my_pmpro_show_password_toggle_member_profile() {
/*
Tell PMPro to filter the_content a bit later.
This will sometimes fix issues where theme or plugin elements (e.g. videos)
are not being filtered by PMPro. Note that this sometimes will cause
some things (e.g. share links) to be filtered that you don't want to be
filtered... and sometimes edits to the theme or a child theme are
required to get the desired effect.
Add this to your active theme's fucntions.php or a custom plugin.
@dwanjuki
dwanjuki / pmpro-remove-members-list-csv-headings.php
Last active November 10, 2023 15:20 — forked from ipokkel/pmpro-remove-members-list-csv-headings.php
Remove columns from the PMPro Memberslist CSV export.
<?php
/**
* Remove columns from the Members Export CSV
*
* 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/
*/