Skip to content

Instantly share code, notes, and snippets.

View dwanjuki's full-sized avatar

David Wanjuki dwanjuki

  • Nairobi, Kenya
  • 05:19 (UTC +03:00)
View GitHub Profile
@dwanjuki
dwanjuki / my-pmpro-series-shortcode.php
Created March 7, 2025 14:54 — forked from ipokkel/my-pmpro-series-shortcode.php
Shortcode to display a series' list of articles with their available date. #pmpro_series #shortcode
<?php
/**
* This recipe creates a shortcode that shows the list of articles for a specific series.
* Use [pmpro_series id="n"] on any page/post to display a list of posts that belong to a series.
* The attribute "id" is the post ID of the series and is required, e.g [pmpro_series id="123"]
*
* This recipe assumes the site has the PMPro Series: Drip Feed Add On active.
* @link https://www.paidmembershipspro.com/add-ons/pmpro-series-for-drip-feed-content/
*
* You can add this recipe to your site by creating a custom plugin
@dwanjuki
dwanjuki / my_pmpromm_marker_content.php
Created March 4, 2025 10:15
Remove the Display Name from the Membership Maps infowindow
<?php
/**
* Remove the Display Name from the Membership Maps infowindow
*
* 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_grant_users_free_post_access.php
Last active March 3, 2025 10:31
Grant specific users free access to specific restricted posts
<?php // copy from below
/**
* Grant specific users free access to specific 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 my_pmpro_grant_users_free_post_access( $hasaccess, $mypost, $myuser, $post_membership_levels ) {
@dwanjuki
dwanjuki / my_pmpro_show_hide_discount_code.php
Last active February 28, 2025 09:05 — forked from JarrydLong/mypmpro-hide-discount-field-specific-level.php
Show the discount code field on checkout for specified levels, hide on others
<?php
/**
* Show the discount code field on checkout for specific levels 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 / add_excerpt_to_wordpress_page.php
Last active February 26, 2025 09:24 — forked from andrewlimaza/add_excerpt_to_wordpress_page.php
Add Excerpt Functionality To WordPress Pages
<?php
/**
* Add Excerpt Functionality To WordPress 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 / my_pmpro_pages_dequeue_lpv_js.php
Last active February 19, 2025 09:52
Stops the Limit Post Views JavaScript loading on PMPro pages
<?php
/**
* Stops the Limit Post Views JavaScript loading on PMPro 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/
*/
function my_pmpro_pages_dequeue_lpv_js() {
@dwanjuki
dwanjuki / my_member_only_rest_api_routes.php
Last active February 21, 2025 07:56
Require membership for some WP REST API routes
<?php
/**
* Require membership for some REST API routes
*
* 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_member_only_rest_api_routes( $errors ) {
@dwanjuki
dwanjuki / my_pmpro_convertkit_add_tag_on_subscribe.php
Created February 13, 2025 11:34
Tag users in Kit based on user field submissions
<?php
/**
* Tag users in Kit after level changes based on user field submissions
*
* To get the ID for your existing tags click on the tag name on the Subscribers page on Kit
* and check the value of the subscribable_ids parameter in the URL
*
* 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.
@dwanjuki
dwanjuki / my_pmpro_member_has_payment_plan.php
Created January 30, 2025 08:02
Check if a user is on a specific payment plan
<?php
/**
* Check if a user is on a specific payment plan by plan id
*
* Example Usage: if( my_pmpro_member_has_payment_plan( 'L-2-P-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 / my_pmpro_invoice_remove_group_info.php
Created January 27, 2025 10:47
Remove Group Account information from Invoice and Confirmation pages
<?php
/**
* Remove Group Account information from Invoice and Confirmation 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/
*/