Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@strangerstudios
strangerstudios / gist:3100680
Created Jul 12, 2012
Hidden Levels for Paid Memberships Pro
View gist:3100680
<?php
/*
Plugin Name: PMPro Hidden Levels
Plugin URI: http://www.paidmembershipspro.com/pmpro-hidden-levels/
Description: With this plugin, select levels are removed from the levels page but still available for checkout if you visit the checkout URL directly.
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@kimcoleman
kimcoleman / remove_the_pmpro_actions_nav_separator.php
Last active Aug 5, 2020
Remove the vertical bar | in the various action nav groups on Membership Account, Log In widget, and more.
View remove_the_pmpro_actions_nav_separator.php
<?php
/**
* Remove the vertical bar | in the various action nav groups on Membership Account, Log In widget, and more.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
*/
@andrewlimaza
andrewlimaza / rh-file-upload-members-csv.php
Created Jul 31, 2020
Add Register Helper File Upload Field to Member's CSV Export
View rh-file-upload-members-csv.php
<?php
/**
* Add the full URL of a file upload field to member export CSV.
* Adjust the 'my_image' value with the relevant Register Helper field key.
* You can add this code snippet to your WordPress site following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
// Add a custom column to the CSV export.
function my_pmpro_members_list_csv_extra_columns ( $columns ) {
$columns["uploaded"] = "my_pmpro_members_list_uploaded";
@andrewlimaza
andrewlimaza / example-pmpro-login-redirect.php
Created Jun 2, 2020
Example of pmpro_login_redirect_url filter
View example-pmpro-login-redirect.php
<?php
/**
* Example to redirect all user's to a specific page when logging in via Paid Memberships Pro site.
*/
function my_login_redirect( $redirect_to, $request, $user ) {
return home_url(); // redirect to home page on login.
}
add_filter( 'pmpro_login_redirect_url', 'my_login_redirect', 10, 3 );
@andrewlimaza
andrewlimaza / my_logout_go_home.php
Created Aug 9, 2016
Redirect users to home page when logging out of WordPress
View my_logout_go_home.php
<?php
//copy lines 5 onwards into your active theme's function.php or custom plugin for code snippets.
function my_logout_go_home(){
wp_redirect( home_url() );
exit();
}
add_action( 'wp_logout', 'my_logout_go_home' );
@ipokkel
ipokkel / my-default-wp-user-checkout-fields.php
Last active Jul 24, 2020 — forked from strangerstudios/my_default_wp_user_checkout_fields.php
Capture default user profile fields at Membership Checkout using Register Helper and save with custom callback using save_function for RH
View my-default-wp-user-checkout-fields.php
<?php
/**
* This recipe adds Website and Biographical Info to the Membership Checkout.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@ideadude
ideadude / pmpro-cpt.php
Last active Jul 22, 2020 — forked from strangerstudios/pmpro-cpt.php
Add the PMPro meta box to a CPT. Add this to your plugin/etc.
View pmpro-cpt.php
<?php
/**
* Add the PMPro meta box to a CPT
*/
function my_add_pmpro_meta_box_to_cpts() {
// Duplicate this row for each CPT. This one adds the meta boxes to 'product' CPTs.
add_meta_box('pmpro_page_meta', 'Require Membership', 'pmpro_page_meta', 'product', 'side' );
}
add_action( 'admin_menu', 'my_add_pmpro_meta_box_to_cpts', 20 );
@ipokkel
ipokkel / my-pmpromd-custom-profile-shortcode.php
Created Jun 5, 2020
Custom shortcode that applies wpautop to the user bio to automatically create paragraphs from double line breaks.
View my-pmpromd-custom-profile-shortcode.php
<?php
/**
* This recipe replaces the function for the shortcode [pmpro_member_profile]
* with a custom shortcode function that applies wpautop to the user bio,
* which creates paragraphs from double line breaks.
* @link https://developer.wordpress.org/reference/functions/wpautop/
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
@ipokkel
ipokkel / readonly-on-profile-example.php
Created Jan 21, 2020
Example Register Helper field that displays as read only to the user on the WordPress profile page.
View readonly-on-profile-example.php
<?php
/**
* PMPro Customization: Register Helper - Add date of birth date picker to checkout
* Display field as read-only for user but as editable field for administrators
*/
//we have to put everything in a function called on init, so we are sure Register Helper is loaded
function my_pmprorh_init() {
//don't break if Register Helper is not loaded
@andrewlimaza
andrewlimaza / custom-depends-register-helper-simple-example.php
Created Aug 29, 2018
Multiple Depends example for Register Helper and Custom JQuery.
View custom-depends-register-helper-simple-example.php
<?php
/**
* This is a simple example that references a select drop down and when a certain option is selected will it show.
* Add this code to your PMPro Customizations and tweak to your liking.
*/
function my_pmprorh_init() {
//don't break if Register Helper is not loaded
if(!function_exists( 'pmprorh_add_registration_field' )) {
return false;
You can’t perform that action at this time.