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 / 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' ) ) {
@travislima
travislima / my_pmpro_login_redirect_url.php
Last active May 22, 2019 — forked from messica/my_pmpro_login_redirect_url.php
Redirect on login if user has any failed payments. (Requires Paid Memberships Pro Failed Payment Limit Add On)
View my_pmpro_login_redirect_url.php
<?php
/*
* Redirect on login if user has any failed payments. (Requires Paid Memberships Pro Failed Payment Limit Add On)
* Adjust the code on the line the line "site_url( ' payment-failed')" to redirect to page of your prefereance.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_login_redirect_url( $url, $request, $user ) {
@travislima
travislima / stop-renewing-members.php
Created Feb 26, 2019 — forked from andrewlimaza/stop-renewing-members.php
Stop members from renewing their current membership level [Paid Memberships Pro].
View stop-renewing-members.php
<?php
/**
* Stop members from renewing their current membership level.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function stop_members_from_renewing( $okay ) {
// If something else isn't okay, stop from running this code further.
if ( ! $okay ) {
@travislima
travislima / hide-pmpro-checkout-fields.css
Last active Feb 19, 2019
Hide the Paid Memberships Pro - Username, Password and Confirm Password fields on Checkout.
View hide-pmpro-checkout-fields.css
/* This is to be used in conjuction with the following gist - https://gist.github.com/travislima/6f1d45d3ff236cda4e0d8d871adc8d9b */
.pmpro_checkout-field-username ,
.pmpro_checkout-field-password ,
.pmpro_checkout-field-password2 {
display: none;
}
@travislima
travislima / generate-field-data-for-specific-levels.php
Created Feb 19, 2019 — forked from andrewlimaza/generate-field-data-for-specific-levels.php
Generate fields for free membership levels, or specific levels.
View generate-field-data-for-specific-levels.php
<?php
/**
* This will generate information for username, password and password 2. This is great for free levels.
* Adjust the $generate_data_level ID's to allow data generation for specific levels.
* Use CSS to hide these fields on the checkout page from the frontend.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
// Function to make fields optional for free levels.
function my_generate_fields_for_users() {
@travislima
travislima / load-my-script-pmpro.php
Last active Apr 26, 2019 — forked from andrewlimaza/load-my-script-pmpro.php
Load content on confirmation or checkout page for PMPro.
View load-my-script-pmpro.php
<?php
/**
* Load content for specific pages, checkout or confirmation page
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function load_my_script_for_pmpro() {
global $pmpro_pages;
if ( is_page( $pmpro_pages['checkout'] ) || is_page( $pmpro_pages['confirmation'] ) || is_page( $pmpro_pages['account'] ) || is_page( $pmpro_pages['billing'] ) || is_page( $pmpro_pages['cancel'] ) || is_page( $pmpro_pages['invoice'] ) || is_page( $pmpro_pages['levels'] ) || is_page( $pmpro_pages['popup-cvv'] ) ) {
?>
View add-shipping-address-to-admin-order.php
<?php
/**
* This will add Shipping Address information when an admin view's the user's order in the WordPress dashboard.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_add_shipping_address_to_admin_order_view( $order ) {
$user_id = $order->user_id;
View register_helper_checkbox_example.php.php
<?php
/**
* Add the following code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations
* In this example you will learn how to add 3 checkboxes to Paid Memberships Pro Checkout page.
*/
function rh_fields_example_checkbox()
{
//don't break if Register Helper is not loaded
@travislima
travislima / my-pmpro-valid-shipping-zip-codes.php
Last active Jan 11, 2019 — forked from andrewlimaza/my-pmpro-valid-shipping-zip-codes.php
Only allow shipping to specific Zip Codes for Paid Memberships Pro Shipping.
View my-pmpro-valid-shipping-zip-codes.php
<?php
/**
* This will only allow users to checkout with specific zip codes for the Shipping Add On for Paid Memberships Pro.
* You will need to use this code recipe together with the PMPro Shipping Address Add On - https://www.paidmembershipspro.com/add-ons/shipping-address-membership-checkout/
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_valid_zip_codes( $pmpro_continue_registration ) {
@travislima
travislima / rh_ex_customer.php
Created Dec 7, 2018
RH: Example for Customer.
View rh_ex_customer.php
<?php
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
You can’t perform that action at this time.