Skip to content

Instantly share code, notes, and snippets.

View ronalfy's full-sized avatar
🏠
Working from home

Ronald Huereca ronalfy

🏠
Working from home
View GitHub Profile
@ronalfy
ronalfy / pmpro-add-notes-order-columns-admin-csv.php
Created October 12, 2020 18:07
PMPro - Add Notes to Order Columns in Admin and CSV
<?php
/**
* Adds a notes tab in the admin area and in the order CSV export.
*
* 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/
*/
/**
@ronalfy
ronalfy / pmpro-extra-fields.php
Created October 12, 2020 16:23
PMPro - Add Extra Fields - Sync with Add User from Admin
<?php
/**
* Modified customer gist. Adds profile fields and saves them.
* Compatible with Add User from Admin Add-On
*
* 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/
*/
@ronalfy
ronalfy / pmpro-redirect-bbpress-archive-login-page.php
Created October 12, 2020 15:03
PMPro - Redirect Forum Archive - Login Page
<?php
/**
* Forwards non-logged-in-users going to /forums/ to the WordPress login URL.
*
* 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/
*/
function pmpro_maybe_redirect_bbpress_forums_archive() {
@ronalfy
ronalfy / pmpro-qr-code-avatar.php
Created October 9, 2020 15:50
PMPro - QR Code as Avatar
<?php
/**
* This recipe replaces a user's avatar with a QR code.
*
* 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/
*/
/**
@ronalfy
ronalfy / pmpro-show-membership-number-level,.php
Created October 8, 2020 15:12
PMPro - Show Membership Number Only for Certain Level
<?php
/**
* Generates a membership number for each user. If they are not in a
* specified level, the membershpip number does not show.
*
* 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/
*/
@ronalfy
ronalfy / pmpro-profile-grid-tabs.php
Last active October 7, 2020 18:58
PMPro - Add Tab to ProfileGrid Plugin Profile Page
<?php
/**
* Add a membership tab to the ProfileGrid plugin. Show profile edit information.
*
* @plugin https://wordpress.org/plugins/profilegrid-user-profiles-groups-and-communities/
* @plugin https://wordpress.org/plugins/paid-memberships-pro/
*
* 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.
@ronalfy
ronalfy / pmpro-mmpu-override-levels-template.php
Last active November 19, 2020 04:26
Paid Memberships Pro - MMPU Override Levels Template
<?php
/**
* The recipe checks for a /paid-memberships-pro/pages/levels.php in the child theme
*
* 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/
*/
function my_pmpro_pmprommpu_override_user_pages( $templates, $page_name, $type, $where, $ext ) {
@ronalfy
ronalfy / pmpro-jquery-move-required.php
Created September 24, 2020 16:37
PMPro - jQuery - Move Asterisk
<?php
/**
* Moves the asterisk next to the label.
*
* 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/
*/
function pmpro_move_required_asterisk_checkout() {
@ronalfy
ronalfy / my_pmpro_fee-to-certain-levels.php
Last active September 22, 2020 15:53 — forked from dparker1005/my_pmpro_add_account_creation_fee.php
Charge Processing Fee to Certain Levels
<?php
/**
* If user checkouts in certain levels, add a processing fee.
*
* 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/
*/
function my_pmpro_add_account_creation_fee( $checkout_level ) {
@ronalfy
ronalfy / pmpro-set-start-date-end-date.txt
Created September 17, 2020 18:46
Paid Memberships Pro - Set Start and End Dates
/**
* Show SQL query examples for setting a start and end date for users without one.
*
* PLEASE BACK UP YOUR DATABASE FIRST BEFORE ATTEMPTING ANY OF THESE QUERIES
*/
/* Get users with no end date - Useful for checking how many there are */
select * from wp_pmpro_memberships_users where enddate is NULL OR enddate = '0000-00-00 00:00:00'
/* Get users with no start date - Useful for checking how many there are */