Skip to content

Instantly share code, notes, and snippets.

View itsjusteileen's full-sized avatar
🎯
Focusing

Eileen Violini itsjusteileen

🎯
Focusing
View GitHub Profile
@itsjusteileen
itsjusteileen / redirect_users_after_login.php
Created October 8, 2018 03:38 — forked from andrewlimaza/redirect_users_after_login.php
Redirect Users After Login For WordPress
<?php
/**
* Redirect all non-admin user's after they login to your website's home page.
* Documentation for login_redirect filter - https://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect
* Visit https://yoohooplugins.com for more tutorials.
*/
function yh_redirect_after_login( $redirect_to, $request, $user ) {
if ( isset( $user->roles ) && is_array( $user->roles ) ) {
@itsjusteileen
itsjusteileen / my_pmpro_bbpress_profile_template_redirect.php
Created October 8, 2018 03:56 — forked from strangerstudios/my_pmpro_bbpress_profile_template_redirect.php
Redirect the Membership Account page to the bbPress User Profile.
/*
Redirect the Membership Account page to the bbPress User Profile.
*/
function my_pmpro_bbpress_profile_template_redirect()
{
global $pmpro_pages, $current_user;
//make sure PMPro is active
if(empty($pmpro_pages))
return;
@itsjusteileen
itsjusteileen / move-something.js
Last active October 11, 2018 15:03 — forked from pbrocks/move-something.js
Use jQuery to move a Sponsored Seats field on the Checkout page
jQuery(document).ready(function($){
$('#pmpro_extra_seats').appendTo($('#other_discount_code_p').parent());
});
@itsjusteileen
itsjusteileen / pmpro-remove-billing-address-fields-headings-csv.php
Created October 12, 2018 22:16 — forked from greathmaster/pmpro-remove-billing-address-fields-headings-csv.php
Remove Billing addresses fields and headings from CSV Member export
function my_pmpro_members_list_csv_default_columns($default_columns)
{
$new_default_columns = array();
$remove = array('pmpro_bfirstname', 'pmpro_blastname', 'pmpro_baddress1', 'pmpro_baddress2', 'pmpro_bcity', 'pmpro_bstate', 'pmpro_bzipcode', 'pmpro_bcountry', 'pmpro_bphone');
foreach($default_columns as $key => $value)
{
if(!in_array($value[1], $remove))
$new_default_columns[] = $value;
}
@itsjusteileen
itsjusteileen / memberlite-banner-expiration-notification.php
Created October 29, 2018 15:39 — forked from kimcoleman/memberlite-banner-expiration-notification.php
Display a banner that notifies users about their upcoming expiration - Memberlite method.
<?php
/**
* This code will display a renewal reminder notification banner at the top of your website for members whose membership
* level will expire within 7 days of the date they visit your site.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Note: When adding to your Customizations Plugin, be careful not to include the opening php tag on line 1 above.
*/
function memberlite_show_banner_renewal_message(){
global $pmpro_pages;
@itsjusteileen
itsjusteileen / pmpro-billing-fields-to-profile.php
Last active January 4, 2019 23:26 — forked from pbrocks/pmpro-billing-fields-to-profile.php
Add the billing fields created by Paid Memberships Pro to your user and BuddyPress profile and inclusion in the Members List CSV export
<?php
/**
* Plugin Name: PMPro Profile Fields
*
* Add PMPro billing fields to the WordPress and BuddyPress user profiles
*
* You must have installed both Paid Memberships Pro and the PMPro Register Helper plugins
*
* https://github.com/strangerstudios/pmpro-register-helper
*/
@itsjusteileen
itsjusteileen / pmpro-level-selection-popup.php
Created February 2, 2019 19:11 — forked from pbrocks/pmpro-level-selection-popup.php
PMPro Level selection popup shortcode
<?php // do no include in Customizaations Plugin
/**
* Plugin Name: PMPro Levels Popup
* Description: Add Level selection to a popup
*/
add_shortcode( 'pmpro-levels2-popup', 'pmpro_levels_select_shortcode2' );
function pmpro_levels_select_shortcode2() {
global $wpdb, $pmpro_msg, $pmpro_msgt, $current_user;
@itsjusteileen
itsjusteileen / pmpro_level_expiring_soon_example.php
Created February 2, 2019 23:55 — forked from andrewlimaza/pmpro_level_expiring_soon_example.php
Change when user can renew their membership PMPro
<?php
/**
* Allow members to only renew if their membership expires in 45 days or less.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function custom_pmpro_is_level_expiring_soon( $r, $level ) {
$days = 45; //change number of days before someone is allowed to renew.
@itsjusteileen
itsjusteileen / pmpro_days_left_example.php
Last active February 2, 2019 23:58 — forked from andrewlimaza/pmpro_days_left_example.php
Add days left to new membership level purchase for Paid Memberships Pro WooCommerce.
<?php
/**
* Calculate days remaining for current membership level and add it to new subscription.
* Only works for PMPro WooCommerce Integration
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* www.paidmembershipspro.com
*/
function pmprowoo_add_days_to_level( $level_array ) {
$level_obj = pmpro_getLevel($level_array['membership_id']);
@itsjusteileen
itsjusteileen / pmpro-append-to-end.php
Last active February 3, 2019 00:10 — forked from eighty20results/pmpro-append-to-end.php
When user renews membership we append the duration to their current enddate
<?php
/*
Plugin Name: Paid Memberships Pro: Extend membership by new level duration
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: On change of level, modify the end date to add the new level's time
Version: 1.0
Requires: 4.5.3
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/