Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 12:55 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my_pmpromd_filter_document_title.php
Created November 14, 2024 09:45
Set a custom page title for PMPro Member Directory Profile pages
<?php
/**
* Set a custom page title for PMPro Member Directory Profile pages
*
* 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 / conpd-immediately-if-trial.php
Last active November 7, 2024 12:54 — forked from andrewlimaza/conpd-immediately-if-trial.php
Cancel Members Immediately if they cancel during the trial period (Subscription Delays)
<?php
/**
* Cancel members immediately if they are cancelling within the Subscription Delay Limit of their level
*
* Works on PMPro v3.0+
*
* 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 / show_admin_bar_fals.php
Created October 29, 2024 12:03
Hide Admin Bar on the frontend for all users
<?php
/*
* Hide Admin Bar on the frontend for all users
*
* 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 / my_pmprogroupacct_invite_email_content.php
Created October 28, 2024 14:27
Customize Group Account invite emails based on the group level
<?php
/**
* Customize Group Account invite emails based on the group level
*
* 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 / pmpro-open-comments-non-members.php
Last active October 15, 2024 07:37 — forked from andrewlimaza/pmpro-open-comments-non-members.php
Allows non-members to view comments and comment on restricted posts
<?php
/**
* Allows non-members to view comments and comment on restricted posts
*
* 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 make_pmpro_comments_open(){
@dwanjuki
dwanjuki / my_pmpro_new_member_discount_codes.php
Last active October 21, 2024 13:09
Restrict specific discount codes' usage to new members only
<?php
/**
* Restrict specific discount codes' usage to new members only
*
* 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 / my_pmpro_set_max_user_per_export_loop.php
Created October 2, 2024 12:16
Set maximum number of records to process at a time for Members List Export CSV
<?php
/**
* Set max number of records to process at a time for Members List 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/
*/
function my_pmpro_set_max_user_per_export_loop( $max_users_per_loop ) {
@dwanjuki
dwanjuki / pmpro-prevent-checkout-for-current-levels.php
Last active October 1, 2024 07:41 — forked from ipokkel/pmpro-prevent-checkout-for-current-levels.php
Prevent users from checking out for a level they already have, unless the level is expiring soon and the user can renew.
<?php
/**
* Prevent users from checking out for a level they already have,
* unless the level is expiring soon and the user can renew.
*
* 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 / my_update_user_coordinates.php
Created September 26, 2024 14:57
This recipe will geocode the provided address for the specified user
<?php
/**
* This recipe will geocode the provided address for the specified user
*
* Visit /wp-admin/?update_map=1 to run the script.
*
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
* Remove script once done.
*
@dwanjuki
dwanjuki / my_pmpro_membership_status_manage_users_columns.php
Created September 26, 2024 12:50
Add Membership Status to Users list
<?php
/*
* Add membership status to WordPress Users list
*
* Statuses: https://www.paidmembershipspro.com/documentation/advanced/pmpro-database-structure/#10
*
* 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/