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 / 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-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 / 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 / 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 / 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 / pmpro_manage_users_columns.php
Last active September 22, 2018 15:03 — forked from strangerstudios/my_pmpro_manage_users_columns.php
Add extra column for city and state to Members List table for user field added via PMPro City and State Add On
//Add 'City' Column to Users List Header
function pmpro_manage_users_columns($columns) {
$columns['city'] = 'City';
return $columns;
}
add_filter('manage_users_columns', 'pmpro_manage_users_columns');
//Add 'City' Column to Users List Rows
function pmpro_manage_users_custom_column($value, $column_name, $user_id) {
$theuser = get_userdata( $user_id );
@itsjusteileen
itsjusteileen / pmpro_next_billing_date_customization.php
Created September 22, 2018 14:56 — forked from dparker1005/pmpro_next_billing_date_customization.php
Adds the next billing date for a recurring membership to the Members List page of Paid Memberships Pro and the CSV file generated by it.
<?php
/*
* To add 'Next Billing Date' to Members List
*/
//Add 'Next Billing Date' Column to Members List Header
function my_pmpro_memberslist_extra_cols_header($theusers)
{
?>
<th><?php _e('Next Billing Date', 'pmpro');?></th>
<?php
@itsjusteileen
itsjusteileen / directory.php
Created July 31, 2018 19:46 — forked from greathmaster/directory.php
Custom PMPro Member Directory template that links directory entry to their BuddyPress profile instead of the PMPro Member Directory Profile
<?php
/*
->Desc: Custom PMPro Member Directory template that links directory entry to their BuddyPress profile instead of the PMPro Member Directory Profile
->To use: copy this file (directory.php) into [YOUR ACTIVE THEME]/paid-memberships-pro/pmpro-member-directory/
*/
/*
This shortcode will display the members list and additional content based on the defined attributes.
*/
<?php
function my_pmpro_members_list_csv_extra_columns($columns)
{
$columns["donation"] = "my_extra_column_donation";
return $columns;
}
add_filter("pmpro_members_list_csv_extra_columns", "my_pmpro_members_list_csv_extra_columns", 10);
@itsjusteileen
itsjusteileen / pmpro-pmproap-text-changes.php
Created July 5, 2018 19:48 — forked from pbrocks/pmpro-pmproap-text-changes.php
Add this your customizations plugin to alter text for PMPro Add On Packages.
<?php
/**
* Add to PMPro Customizations plugin. Be sure not to include the opening php tag in line 1.
*
* Add this your customizations plugin to alter text for PMPro Add On Packages.
*/
add_action( 'pmpro_invoice_bullets_top', 'pmproap_pmpro_invoice_links_top' );
add_action( 'pmpro_invoice_bullets_top', 'pmproap_pmpro_member_links_top' );
function pmproap_pmpro_invoice_links_top() {
$invoice_title = 'Purchased Add Ons';