Skip to content

Instantly share code, notes, and snippets.

View MaryOJob's full-sized avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@MaryOJob
MaryOJob / pmpro-mc-merge-enddate.php
Last active August 17, 2021 10:59 — forked from ipokkel/pmpro-mc-merge-enddate.php
Add the enddate to Mailchimp Merge fields if it exists otherwise return "N/A"
<?php // do not copy this line
/**
* Add this to a PMPro customizations or Code Snippets Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
**/
add_action( 'pmpro_mailchimp_listsubscribe_fields', 'my_pmpro_mailchimp_listsubscribe_fields', 10, 2 );
function my_pmpro_mailchimp_listsubscribe_fields( $fields, $user ) {
// Get user level
$level = pmpro_getMembershipLevelForUser( $user->ID );
@MaryOJob
MaryOJob / terms-of-service-as-a-link-only.php
Last active November 11, 2021 15:02 — forked from ipokkel/terms-of-service-as-a-link-only.php
Create a a text link to a media file (PDF) for a Terms & Conditions checkbox on checkout. #pmpro #pdf
@MaryOJob
MaryOJob / my_pmpro_no_charge_membership_site.php
Last active August 3, 2021 19:59 — forked from strangerstudios/my_pmpro_no_charge_membership_site.php
Customizations to remove all mention of payments, fees, price, etc for SPECIFIC LEVELS ONLY
<?php // do not copy this line
/*
* Customizations to remove all mention of payments/fees/price for a 100% no-charge membership site.
* Add this to a PMPro customizations or Code Snippets Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_level_cost_text($text, $level) {
if(pmpro_isLevelFree($level))
return "";
@MaryOJob
MaryOJob / my_add_select_all_levels.php
Created July 30, 2021 07:44 — forked from ideadude/my_add_select_all_levels.php
Add "select all" option inside the PMPro Require Membership box
<?php
/**
* Add "select all" option inside the Require Membership box
* 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_add_select_all_levels() {
?>
@MaryOJob
MaryOJob / pmpro-list-member-pages.php
Created July 27, 2021 06:48 — forked from kimwhite/pmpro-list-member-pages.php
Shortcode to display pages a current member has access to...see comments and notes for details.
<?php // do not copy this line.
/**
* Shortcode [member_content_list] to display pages a current member has access to.
* Only shows those pages with explicit membership settings. ie those set with the
* "Require Membership" box on pages, CPTs (if the PMPro CPTs plugin is used), and posts.
* It does not show those posts restricted by categories.
*
* 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.
@MaryOJob
MaryOJob / my_logout_go_home.php
Last active January 6, 2023 23:43 — forked from andrewlimaza/my_logout_go_home.php
Redirect users to a specified page when logging out of your WordPress PMPro site
<?php // DO NOT COPY THIS LINE
//copy lines 5 onwards into your active theme's function.php or custom plugin for code snippets.
function mypmpro_redirect_logout(){
// wp_safe_redirect( '/contact/' ); // use this line to redirect to a specific page on your site
wp_safe_redirect( home_url() ); // use this to redirect to your website home page
exit();
}
add_action('wp_logout','mypmpro_redirect_logout');
@MaryOJob
MaryOJob / my_pmpro_bp_profile.php
Last active July 5, 2021 19:28 — forked from greathmaster/gist:49c5d81e87b1acd084fd590bee47a3e8
Remove "Membership Level" on the BuddyPress profile page, and instead only show the membership level name
<?php // Do not copy this line
/*
* Remove "Membership Level" on the BuddyPress profile page, and instead only show the membership level name
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-* * * customizations/
*/
function my_pmpro_bp_show_level_on_bp_profile() {
if ( !function_exists('pmpro_getMembershipLevelForUser') ) {
@MaryOJob
MaryOJob / pmpro-customizations.php
Created June 17, 2021 06:44 — forked from gausam/pmpro-customizations.php
Adds extra checkout data to the Zapier Add On's after_checkout_data trigger payload.
<?php
/**
* This recipe adds extra checkout data to the Zapier Add On's after_checkout_data trigger payload.
*
* It is intended for use with the Zapier Integration Add On:
* https://www.paidmembershipspro.com/add-ons/pmpro-zapier/
*
* 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.
<?php
/**
* This recipe will add a widget to the member directory where users can filter
* members based on location and distance.
* Requires PMPro Membership Directory > v1.0 + PMPro Membership Maps Add Ons
*
* 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/
@MaryOJob
MaryOJob / pmpro-rh-dob-check.php
Created June 15, 2021 10:50 — forked from greathmaster/pmpro-rh-dob-check.php
Checks birthday on checkout to confirm member is over 21 years.
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
if(!function_exists( 'pmprorh_add_registration_field' )) {
return false;
}
//define the fields
$fields = array();
$fields[] = new PMProRH_Field(