Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
<?php
/**
* This recipe will remove the Non-EU Resident from list from the list of EU countries to validate VAT numbers.
*
* 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
/**
* Move PMPro checkout fields using jQuery.
*
* 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_move_pmpro_checkout_fields_js() {
@kimwhite
kimwhite / generate-username-from-email-pmpro.php
Last active December 30, 2024 15:37 — forked from JarrydLong/generate-username-from-email-pmpro.php
Generate a username during checkout for user [Paid Memberships Pro]
<?php
/**
* Generate a username at PMPro checkout from email for users.
* 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() {
// add this for manage groups to work
@kimwhite
kimwhite / example-no-access-message-with-button.php
Last active December 5, 2024 18:00 — forked from ipokkel/example-no-access-message-with-button.php
Example of a custom PMPro no access message body with a button link.
<?php
/**
* Customize the no access message with a button.
*
* 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_no_access_message_body_with_button( $body, $level_ids ) {
@kimwhite
kimwhite / pmpro-group-accounts-wp-menu-dynamic-link.php
Last active February 20, 2025 11:12 — forked from andrewlimaza/pmpro-group-accounts-wp-menu-dynamic-link.php
Create dynamic "Manage Account" link to be used in WordPress Menus for Paid Memberships Pro Group Accounts
<?php
/*
Add data from the pmpro_memberships_users table
The pmpro_members_list_csv_extra_columns passes an array of columns.
The keys of the array are the column headings. The values are callback functions to get the value for that row.
*/
//add the column to the export
function my_pmpro_members_list_csv_extra_columns ( $columns ) {
$columns["startdate"] = "my_pmpro_members_list_column_a";
@kimwhite
kimwhite / format_video_profile_field.php
Created October 29, 2024 13:30 — forked from kimcoleman/format_video_profile_field.php
Add a container to wrap a video oembed field and make it responsive.
<?php
/**
* Wrap the oembed video in a div so we can use custom CSS to make the video responsive inside the container.
* You must also add the following custom CSS to your site:
* .video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; }
* .video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
*/
function format_media_profile_field( $value, $original_value, $field_name ) {
// Define the fields that should use the 'media-container' class
$responsive_fields = array( 'video_link_1', 'video_link_2', 'video_link_3' );
@kimwhite
kimwhite / pmpro-approvals-denied-gets-set-level.php
Last active October 29, 2024 11:58 — forked from andrewlimaza/pmpro-approvals-delete-deny.php
Delete User on PMPro Approvals Deny. Delete denied user.
<?php // do not copy this line.
/**
* Automatically give user a set level when their approval is denied.
*
* 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 / mypmpro_member_directory_sql_search_where.php
Last active March 27, 2025 16:15 — forked from dwanjuki/mypmpro_member_directory_sql_search_where.php
Exclude user meta from the member directory search sql query
<?php // copy from here
/*
* Exclude user meta from the member directory search sql query (added a custom user field too)
*
* 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 mypmpro_member_directory_sql_search_where( $sql_search_where, $s ) {
@kimwhite
kimwhite / my_show_userid_on_membership_card.php
Created October 21, 2024 18:04 — forked from dwanjuki/my_show_userid_on_membership_card.php
Show WordPress User ID on Membership Card
<?php
/**
* This recipe will add the member's WordPress User ID to your 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/
*/