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 / 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-customizations.php
Created October 2, 2018 01:52
PMPro Customization to Add a Role to a User Level
<?php // do no include in Customizations Plugin
/**
* When registering, add the member to a specific membership level
*
* @param integer $user_id
*/
// Disables the pmpro redirect to levels page when user tries to register
add_filter( 'pmpro_login_redirect', '__return_false' );
@itsjusteileen
itsjusteileen / pmpro-customizations.php
Last active October 3, 2018 09:47
Paid Memberships Pro Sponsored/Group Members Set Up for One Level with Three Seats
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for my Paid Memberships Pro Setup
Version: .1
Author: Paid Memberships Pro
Author URI: https://www.paidmembershipspro.com
*/
@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 / Insert PMPro Level Button
Last active September 21, 2018 20:28
Adds a PMPro Level Checkout button to the checkout page
<?php // do not include in Customizations plugin
/**
* Add PMPro Level Checkout button to checkout page.
*
* Add this code to a PMPro customization plugin.
*
*/
add_action( 'pmpro_checkout_after_level_cost', 'insert_pmpro_level_button' );
function insert_pmpro_level_button() {
@itsjusteileen
itsjusteileen / pmpro-custom-confirmation-page
Created September 14, 2018 17:49
PMPro Confirmation Page Template Shortcode
<?php
/**
* Add to PMPro Customizations plugin. Be sure not to include the opening php tag in line 1.
*
* Add this your customizations plugin to update text on the PMPro Confirmation Page Template.
* https://www.paidmembershipspro.com/documentation/templates/customizing-via-a-custom-plugin/
*/
function my_pmpro_pages_shortcode_confirmation($content)
@itsjusteileen
itsjusteileen / pmpro-add-login-box.php
Created September 13, 2018 16:49
Add the WordPress login box to the Paid Memberships Pro checkout page
<?php // do not add to your customizations plugin
/**
* An extension allowing existing members to login from the main checkout page to their account to renew or update their membership.
*/
add_action( ‘pmpro_checkout_after_pricing_fields’, ‘a_little_login_thing’ );
function a_little_login_thing() {
$label = ucwords( preg_replace( ‘/-+/‘, ’ ‘, substr( basename( __FILE__ ), 0, -4 ) ) );
echo ‘<h4> The filter, <span style=“color:grey;“>’ . current_filter() . ‘</span>, calls this function: <span style=“color:grey;“>’ . __FUNCTION__ . ‘</span> on Line ’ . __LINE__ . ' of the file ' . basename( __FILE__ ) . ' in the ' . $label . ' plugin</h4>‘;//a diagnostic line you can remove
@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.
*/