Skip to content

Instantly share code, notes, and snippets.

Travis Lima travislima

Block or report user

Report or block travislima

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@travislima
travislima / show_member_number_on_card.php
Last active Oct 11, 2019 — forked from andrewlimaza/show_member_number_on_card.php
Display the Unique Member Number on Membership Card Add On Paid Memberships Pro
View show_member_number_on_card.php
<?php
/**
* This will show a member number on the membership card for Paid Memberships Pro. Please read all comments below!
* This requires the following - https://www.paidmembershipspro.com/generate-a-unique-member-number-for-display-on-membership-account-confirmation-email-and-more/
* At the time of this writing, created a custom page template and added in hook "do_action( 'pmpro_membership_card_additional_fields', $pmpro_membership_card_user );" to the relevant area.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Reach out to the PMPro Support team for help with this code recipe - https://www.paidmembershipspro.com/support/
*/
@travislima
travislima / pmpro-member-number-csv.php
Last active Oct 11, 2019 — forked from greathmaster/pmpro-member-number-csv.php
Show member number in Members List and Members List CSV export.
View pmpro-member-number-csv.php
<?php
/**
* Show member number in Members List and Members List CSV export.
* Useful for offering multiple pricing structures for membership (i.e. Monthly, Annually).
* Requires the PMPro Member Unique Number Code Recipe - https://www.paidmembershipspro.com/generate-a-unique-member-number-for-display-on-membership-account-confirmation-email-and-more/
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_members_list_csv_extra_columns($columns)
@travislima
travislima / bcc-admin-email-for-a-level.php
Created Oct 1, 2019 — forked from andrewlimaza/bcc-admin-email-for-a-level.php
BCC email addresses based on membership level.
View bcc-admin-email-for-a-level.php
<?php
/**
* Tweaked from BCC Admin on Member Emails - https://www.paidmembershipspro.com/bcc-additional-email-addresses-on-member-or-admin-notifications/
* Add this code to your PMPro Customizations Plugin.
* Adjust the membership ID to match that of your levels.
*/
function my_pmpro_email_headers( $headers, $email ) {
// Default BCC address to default email address.
@travislima
travislima / my_pmpro_payment_plan_checkout_boxes.php
Last active Sep 24, 2019 — forked from dparker1005/my_pmpro_payment_plan_checkout_boxes.php
Define payment plans by mapping a level to discount codes representing payment plan options
View my_pmpro_payment_plan_checkout_boxes.php
<?php
/**
* Create payment plans by mapping a level to discount codes representing payment plan options.
* Useful for offering multiple pricing structures for membership (i.e. Monthly, Annually)
*
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
// Define the payment plans. '3' => array( 11, 12, 13 ) means that membership level with the ID of 3 can be paid using discount codes with the ID 11, 12, and 13
@travislima
travislima / gist:3a534702aa87ff1f0d31249f18939c02
Created Sep 10, 2019 — forked from andrewlimaza/gist:bdc325dfa544fd8b4026fbd95ac817f4
Show 'Member ID' on the account page for Paid Memberships Pro
View gist:3a534702aa87ff1f0d31249f18939c02
<?php
/**
* This shows the WordPress User ID as a Member ID on the Paid Memberships Pro Account Page.
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* www.paidmembershipspro.com
*/
function pmpro_add_user_id_account() {
global $current_user;
@travislima
travislima / pmprozapier_email_after_change_level.php
Last active Aug 27, 2019 — forked from LMNTL/pmprozapier_email_after_change_level.php
Send WP new user email and PMPro admin change email after registering a member through a PMPro Zapier zap
View pmprozapier_email_after_change_level.php
<?php
/**
* Send WP new user email and PMPro admin change email after registering a member through a PMPro Zapier zap
* Requires Paid Memberships Pro and PMPro Zapier add on to be installed and activated - https://www.paidmembershipspro.com/add-ons/pmpro-zapier/
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_zapier_email_after_change_level( $level_id, $user_id ){
if( isset( $_SERVER["REQUEST_URI"] ) && ( strpos( $_SERVER["REQUEST_URI"], "pmpro_zapier_webhook" ) !== false ) ){
@travislima
travislima / next_payment_date_account.php
Created Aug 20, 2019 — forked from andrewlimaza/next_payment_date_account.php
Show next payment date under the 'Expiration' field in the PMPro Account Page
View next_payment_date_account.php
<?php
/**
* Show next payment date under 'Expiration' field in PMPro account page.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Works for PayPal Express and Stripe payment gateways.
* www.paidmembershipspro.com
*/
// Change the expiration text to show the next payment date instead of the expiration date
// This hook is setup in the wp_renewal_dates_setup function below
function my_pmpro_expiration_text($expiration_text) {
@travislima
travislima / member-phone-number-pmpro.php
Last active Aug 12, 2019 — forked from andrewlimaza/member-phone-number-pmpro.php
Add phone number to checkout for Paid Memberships Pro.
View member-phone-number-pmpro.php
<?php
/**
* Adds a custom phone field to PMPro checkout page.
* Requires the PMPro Register Helper Add On to be installed and activated - https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
@travislima
travislima / exclude-discount-woocommerce-categories.php
Created Jul 23, 2019 — forked from andrewlimaza/exclude-discount-woocommerce-categories.php
Exclude membership discount for products in a certain category for WooCommerce and Paid Memberships Pro.
View exclude-discount-woocommerce-categories.php
<?php
/**
* This will exclude products that belong to a specific category from the membership discount.
* Add the below code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_exclude_woocommerce_discounts_for_categories( $price, $level_id, $original_price, $product ) {
// Array of categories to exclude, uses category slug.
$exclude_categories = array( 'category-1', 'category-2', 'category-3' );
@travislima
travislima / hide_post_thumbnail_on_restricted_content.php
Last active May 27, 2019 — forked from kimcoleman/hide_post_thumbnail_on_restricted_content.php
Do not return the post thumbnail (featured image) on restricted content when viewed by a non-member.
View hide_post_thumbnail_on_restricted_content.php
<?php
/**
* Do not return the post thumbnail (featured image) on restricted content when viewed by a non-member.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
*
*/
function hide_post_thumbnail_on_restricted_content( $html, $post_id, $post_image_id ) {
if ( function_exists( 'pmpro_has_membership_access' ) ) {
You can’t perform that action at this time.