Skip to content

Instantly share code, notes, and snippets.

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

Mary Mojisola Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@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 ) {
@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;
<?php
/**
* Customize the registration error 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/
*/
function custom_registration_error_message( $errors, $sanitized_user_login, $user_email ) {
@JarrydLong
JarrydLong / pmpro-payment-plan-select-plan-query-param.php
Last active June 28, 2024 13:49 — forked from andrewlimaza/pmpro-payment-plan-select-plan-query-param.php
Select Paid Memberships Pro Payment Plan via query parameter
<?php
/**
* Add &pmpropp_chosen_plan=<<plan_id>> in the URL to preselect the payment plan option.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_payment_plan_select_url() {
// Only load this on the checkout page.
if ( function_exists('pmpro_is_checkout') && !pmpro_is_checkout() ) {
return;
}
@kimwhite
kimwhite / my-pmpro-generate-affiliate-code.php
Last active August 13, 2024 15:13
This function adds a default commissionrate when creating affiliate code at checkout.
<?php // do not copy this line.
/**
* This recipe will allow you to set a default commission when using "Automatically create affiliate code?".
* This setting can be found in your level settings.
*
* For use with Affiliate Add On https://www.paidmembershipspro.com/add-ons/pmpro-lightweight-affiliate-tracking/
* 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/
@dwanjuki
dwanjuki / my_pmpro_pbc_order_added_admin_email.php
Created June 21, 2024 09:27
Send admin an email notification on Pay By Check pending order creation
<?php
/**
* Send admin an email notification on Pay By Check pending order creation
*
* 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
function mypmpro_redirect_away_from_wc_endpoint(){
$current_endpoint = WC()->query->get_current_endpoint();
if($current_endpoint == "downloads" ) {
$user = wp_get_current_user();