Skip to content

Instantly share code, notes, and snippets.

View MaryOJob's full-sized avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@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
@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/
*/
@andrewlimaza
andrewlimaza / pmpro-group-accounts-wp-menu-dynamic-link.php
Last active January 27, 2025 09:57
Create dynamic "Manage Account" link to be used in WordPress Menus for Paid Memberships Pro Group Accounts
@kimcoleman
kimcoleman / my_pmpro_template_url_parameter_at_checkout.php
Created October 8, 2024 13:19
Redirect away from checkout if the secret URL parameter is missing.
<?php
/**
* Redirect away from checkout if the secret URL parameter is missing.
*/
function my_pmpro_template_url_parameter_at_checkout() {
global $pmpro_pages;
// Return early if we are not on a PMPro page.
if ( empty( $pmpro_pages ) ) {
return;
@dwanjuki
dwanjuki / my_pmpro_membership_status_manage_users_columns.php
Created September 26, 2024 12:50
Add Membership Status to Users list
<?php
/*
* Add membership status to WordPress Users list
*
* Statuses: https://www.paidmembershipspro.com/documentation/advanced/pmpro-database-structure/#10
*
* 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/
/* Custom styling for the highlight level of the level comparison table */
/* Apply borders to the highlighted column */
.pmpro_advanced_levels-compare_table th.pmpro_level-highlight,
.pmpro_advanced_levels-compare_table td.pmpro_level-highlight {
border-left: 6px solid #00d084;
border-right: 6px solid #00d084;
}
/* Add border to the top of the highlighted column */
@ipokkel
ipokkel / example-no-access-message-with-button.php
Created August 20, 2024 10:09
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-groupleader-child-expiration.php
Created July 26, 2024 14:39
This recipe will show the Group Leaders Expiration Date for the child's membership level.
<?php
/*
* Show the Group Leaders expiration for the child in various places on frontend and admin pages in PMPro.
*
* 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/
*/
@JarrydLong
JarrydLong / my_pmpro_report_login_wp_visits.php
Created July 26, 2024 08:59 — forked from ideadude/my_pmpro_report_login_wp_visits_only_for_users.php
Change PMPro to only track visits for logged in users.
/**
* Change PMPro to not track visits at all
* Add this code into a custom plugin or code snippet.
*/
function my_pmpro_report_login_wp_visits_only_for_users() {
remove_action( 'wp', 'pmpro_report_login_wp_visits' );
}
add_action( 'init', 'my_pmpro_report_login_wp_visits_only_for_users' );
@dwanjuki
dwanjuki / pmpro_advanced_levels-compare_table.css
Created July 24, 2024 08:28
Add a colored border around the highlighted Advanced Levels Compare table column
/* Advanced Levels Compare table - add border to highlighted column */
.pmpro_advanced_levels-compare_table thead th.pmpro_level-highlight,
.pmpro_advanced_levels-compare_table tbody td.pmpro_level-highlight,
.pmpro_advanced_levels-compare_table tfoot td.pmpro_level-highlight {
border-left: 6px solid #00d084;
border-right: 6px solid #00d084;
}
#pmpro_levels.pmpro_advanced_levels-compare_table tfoot tr:last-child td.pmpro_level-highlight {
border-bottom: 6px solid #00d084;