Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 04:35 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / mypmpro_member_directory_sql_search_where.php
Last active October 21, 2024 19:31 — forked from JarrydLong/mypmpro-search-query.php
Exclude user meta from the member directory search sql query
<?php // copy from here
/*
* Exclude user meta from the member directory search sql query
*
* 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 mypmpro_member_directory_sql_search_where( $sql_search_where, $s ) {
@dwanjuki
dwanjuki / mypmpro-assign-membership-level-from-variable-product.php
Last active May 29, 2024 06:48 — forked from JarrydLong/mypmpro-assign-membership-level-from-variable-product.php
This recipe associates a membership level with a Variable product's variation
<?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.
*
@dwanjuki
dwanjuki / pmpro-memberlist-last-login.php
Last active July 27, 2023 06:27 — forked from ipokkel/pmpro-last-login.php
Show member's last login date on the members list columns and include in members list CSV export
<?php
/**
* Display last login date on the members list and include in members list CSV export
*
* 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 / some_one_time_levels.php
Last active August 16, 2023 08:34 — forked from dparker1005/one_time_levels.php
Only allow users to have the specified membership levels once
<?php // Copy from below here...
/**
* Only allow users to have the levels specified in $one_time_levels once.
*
* 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/
*/
<?php
/**
* Do not charge EU customers VAT
*
* 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-additional-fees-checkbox.php
Last active August 24, 2023 12:36 — forked from kimwhite/pmpro-additional-fees-checkbox.php
Adding additional items at checkout using User Fields
<?php
/**
* This recipe will add additional fees and pricing
*
* 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-one-time-signup-fee.php
Last active August 29, 2023 09:13 — forked from kimwhite/pmpro-one-time-signup-fee.php
This will allow you to charge additional extras on the user's fee
<?php // do not copy this line
/**
* This will allow you to charge additional extras on the user's initial payment
*
* 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_clear_report_stats_init.php
Last active September 8, 2023 13:55 — forked from kimwhite/my-pmpro-clear-stats.php
Clear Visits and Views report statistics
<?php // do not copy this line
/**
* Clear Visits and Views report stats
*
* 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/
*
* To Use: Navigate to /wp-admin/?pmprocleardata=1 when logged in as an admin.
<?php
/**
* Make sure approved users are active whenever you run an import using the Import Members From CSV 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 / my_pmpromd_remove_extra_profile_fields.php
Last active October 4, 2023 08:25 — forked from dparker1005/my_pmpromd_remove_extra_profile_fields.php
Removes the Hide From Directory field added by PMPro Member Directory
<?php
// Copy from below here...
/**
* Remove the 'Hide From Directory' option from user profiles
* Add the following function to your PMPro Customizations plugin
* http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpromd_remove_extra_profile_fields() {