View my_memberlite_custom_color_mods.php
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 | |
/** | |
* Memberlite filters to set custom colors for specific pages. | |
*/ | |
// Filter the primary color on a page with the slug 'free'. | |
function my_memberlite_custom_color_primary( $current_mod ) { | |
if ( ! is_page( 'free' ) ) { | |
return $current_mod; | |
} |
View my_pmpro_refund_reason.php
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 | |
/** | |
* Add an order meta field for "Refund Reason" so admin can track | |
* why people are asking for a refund. | |
*/ | |
function my_pmpro_refund_reason_after_order_settings( $order ) { | |
if ( empty( $order->id ) ) { | |
// This is a new order. | |
return; | |
} |
View my_bua_bp_avatar.php
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 | |
/** | |
* Filter to use the Basic User Avatar on the BuddyPress Profile. | |
*/ | |
function my_bua_bp_avatar( $image, $params ) { | |
// Determine if user has a local avatar | |
$local_avatar = get_user_meta( $params['item_id'], 'basic_user_avatar', true ); | |
if ( empty( $local_avatar ) ) { | |
return $image; |
View my_habfna_show_admin_bar_roles.php
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 | |
/** | |
* Filter to show WordPress Toolbar for Editor Role using the | |
* Hide Admin Bar From Non-Admins plugin. | |
* https://wordpress.org/plugins/hide-admin-bar-from-non-admins/ | |
* | |
*/ | |
function my_habfna_show_admin_bar_roles( $habfna_show_admin_bar_roles ) { | |
$habfna_show_admin_bar_roles[] = 'editor'; | |
return $habfna_show_admin_bar_roles; |
View pmpro_add_google_tag_manager_to_body.php
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 | |
/** | |
* Fallback to add GTM to body of page. | |
* | |
*/ | |
function pmpro_add_google_tag_manager_to_body() { | |
// Don't track admins. | |
if ( current_user_can( 'manage_options' ) ) { | |
return; | |
} ?> |
View pmpro_gtag_ecommerce_set_session.php
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 | |
/** | |
* Add a session variable so we only push the ecommerce data to GTM on the first checkout. | |
* Not any subsequent visit to the confirmation page. | |
* | |
*/ | |
function pmpro_gtag_ecommerce_set_session( $user_id, $morder ) { | |
pmpro_set_session_var( 'pmpro_gtag_order', $morder->id ); | |
} | |
add_action( 'pmpro_after_checkout', 'pmpro_gtag_ecommerce_set_session', 10, 2 ); |
View pmpro_add_google_tag_manager_to_head.php
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. |
View my_get_the_terms.php
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 | |
/** | |
* Hide tags from display if there is only one post in the taxonomy. | |
* | |
*/ | |
function my_get_the_terms( $terms, $post_id, $taxonomy ) { | |
if ( $taxonomy === 'post_tag' ) { | |
foreach( $terms as $key => $term ) { | |
if ( $term->count < 2 ) { | |
unset( $terms[ $key ] ); |
View example-post-content-require-membership.html
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
[membership level="0"] | |
Are you interested in learning what the meaning of life is? | |
Sign up today and we'll tell you! | |
[/membership] | |
[membership level="1"] | |
Thanks for being a member of our program. | |
The meaning of life is: 42. |
View memberlite-heading-font-sizes.css
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
h1, | |
h2, | |
.h1, | |
.h2 { | |
font-size: 3.2rem; | |
line-height: 4.4rem; | |
} | |
.entry-content h1, | |
.entry-content .h1 { | |
font-size: 4.7rem; |
NewerOlder