Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / sell-courses-addon-packages.php
Last active April 22, 2024 12:34 — forked from andrewlimaza/sell-series-addon-packages.php
Sell PMPro Series through AddOn Packages
<?php
/**
* Adds the AddOn Package post meta to 'Courses' post type.
* Give access if they purchased "Courses" parent container.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function add_pmpro_courses_to_AP( $types ) {
$types[] = 'courses';
@kimwhite
kimwhite / my-pmpro-custom-error.php
Created March 28, 2024 14:56
Replace the minimum password message provided by library
<?php // do not copy this line.
/**
* This recipe does replaces the default minimum password message
*
* 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/
*/
@kimwhite
kimwhite / french-canadian-price-format.php
Last active March 27, 2024 15:22 — forked from ipokkel/french-canadian-price-format.php
Change the display format of a price. This example will change the price format display to a Hungary format.
<?php
/**
* Change the display format of a price for a specific currency.
*
* 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/
*/
@kimwhite
kimwhite / pmpro-billing-fields-optional.php
Last active March 26, 2024 15:51 — forked from andrewlimaza/pmpro-bstate-optional.php
Make some billing fields optional
<?php
/**
* Remove the bstate baddress2 requirement from billing fields generated by PMPro or Address for Free Levels then hide them with CSS
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_remove_bstate_required( $pmpro_required_billing_fields ){
//remove field ID's from array to make fields required
$remove_field = array('bstate,baddress2');
@kimwhite
kimwhite / generate-username-from-email-pmpro.php
Created February 28, 2024 21:35 — forked from andrewlimaza/generate-username-from-email-pmpro.php
Generate a username during checkout for user [Paid Memberships Pro]
<?php
/**
* Make user name email address the same
* Hide your 'username' field using custom CSS.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_generate_username_at_checkout() {
//check for level as well to make sure we're on checkout page
@kimwhite
kimwhite / reset_the_default_avatar_size_on_a_page.php
Last active February 22, 2024 12:12
Change the Default Avatar Size when using the Basic Avatar Shortcode
<?php
/*
* by default the WordPress Avatar default size is 96x96
* this code will change default WP size for page 56 (you can change this)
* you can choose a size that is available.
* check your Media settings in WordPress Settings Area.
*/
function my_get_avatar( $avatar, $id_or_email, $size, $default, $alt ) {
// Check if we're on page 56
@kimwhite
kimwhite / my_pmpro_remove_change_level_link.php
Created January 31, 2024 18:57 — forked from dparker1005/my_pmpro_remove_change_level_link.php
Removes the 'change' button from the PMPro membership account page
<?php
/**
* This recipe will create a custom field using the Register Helper Add-on, and display the
* respective field on the membership card.
*
* 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/
*/
<?php // do not copy this line.
/**
* This recipe does will move password fields on your PMPro checkout page
*
* 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/
*/
@kimwhite
kimwhite / my-buddyboss-theme-css.css
Created January 18, 2024 17:00
BuddyBoss Theme Levels page - keep button from going out of table on mobile
/* The Select buttons in mobile view will go out of the table on mobile
This CSS will fix this when using the BuddyBoss Theme Version: 2.5.00 */
@media screen and (max-width: 767px) {
#pmpro_levels_table .pmpro_btn {
padding: 5px 5px;
display: block;
min-width: unset;
}
}