This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*--------------------------------------- | |
Buttons | |
---------------------------------------*/ | |
.pmpro_btn {} | |
.pmpro_content_message a {} | |
.pmpro_btn.disabled {} | |
.pmpro_btn.pmpro_btn-cancel {} | |
.pmpro_btn.pmpro_btn-submit-checkout {} | |
input[type="button"]#discount_code_button {} | |
input[type="button"]#other_discount_code_button {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Optional database updates to drop orphaned orders table columns and unused usermeta rows. | |
*/ | |
function run_optional_pmpro_upgrade_3_0() { | |
global $wpdb; | |
// PMPro Stripe Billing Limits Add On has been merged into core and no longer needs `pmpro_stripe_billing_limit` user meta. | |
$sqlQuery = " | |
DELETE FROM {$wpdb->usermeta} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Re-runs the 3.0 upgrade script. | |
*/ | |
function pmpro_upgrade_3_0_rerun() { | |
global $wpdb; | |
// Create a subscription for each unique `subscription_transaction_id` in the orders table. | |
$sqlQuery = " | |
INSERT IGNORE INTO {$wpdb->pmpro_subscriptions} ( user_id, membership_level_id, gateway, gateway_environment, subscription_transaction_id, status ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function memberlite_modify_columns_ratio_for_blog( $r, $location ) { | |
// Check if the current page is a blog page | |
$maybe_add_sidebar = memberlite_is_blog(); | |
if ( $maybe_add_sidebar && ! in_array( $location, array( 'header-right', 'header-left' ) ) ) { | |
// Set layout ratio for the blog main area and sidebar | |
$r = ( $location == 'sidebar' ) ? '4' : '8'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_custom_memberlite_woocommerce_hooks() { | |
// Remove Memberlite hooks | |
remove_action( 'woocommerce_before_main_content', 'memberlite_woocommerce_before_main_content', 10 ); | |
remove_action( 'woocommerce_after_main_content', 'memberlite_woocommerce_after_main_content', 10 ); | |
// Add custom WooCommerce hooks | |
add_action( 'woocommerce_before_main_content', 'my_custom_memberlite_woocommerce_before_main_content', 10 ); | |
add_action( 'woocommerce_after_main_content', 'my_custom_memberlite_woocommerce_after_main_content', 10 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Builds the dataLayer and loads GTM tracking in the head. | |
* Includes Custom Dimensions and Ecommerce data. | |
* | |
*/ | |
function pmpro_add_google_tag_manager_to_head() { | |
global $pmpro_pages; | |
// Don't track admins. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Only search the PMPro Member Directory for matching usernames or display names. | |
* | |
* 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_member_directory_sql_search_where_username_display_name_only( $sql_search_where, $s ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This will show '0/X spots available.' on membership level if a limit is set from (https://www.paidmembershipspro.com/limit-number-members-membership-level/) | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* For help, post a support thread on www.paidmembershipspro.com | |
*/ | |
function pmpro_show_spots_available( $expiration_text, $level ) { | |
global $wpdb; |
NewerOlder