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
/** | |
* Removes RP4WP display when a post is in a certain category | |
**/ | |
function br_disable_rp4wp_category( $content ) { | |
if ( in_category( 'excluded-category-slug' ) ) { | |
add_filter( 'rp4wp_append_content', '__return_false'); | |
} | |
return $content; |
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 | |
// Display a top notice to non-members for members-only products | |
function sv_members_only_product_notice() { | |
if ( ! function_exists( 'wc_memberships' ) ) { | |
return; | |
} | |
$user_id = get_current_user_id(); |
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
function wpml_wc_api_home_url( $url, $path, $orig_scheme, $blog_id ) { | |
global $sitepress; | |
if ( isset( $sitepress ) && 0 === strpos( $path, 'wc-api/' ) ) { | |
$url = $sitepress->convert_url( str_replace( $path, '', $url ), $sitepress->get_default_language() ); | |
$url = untrailingslashit( $url ) . '/' . ltrim( $path, '/' ); | |
} | |
return $url; |
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 | |
// Change the delayed content message for the "Projects" post type | |
function sv_filter_content_delayed_message( $message, $post_id, $access_time ) { | |
if ( 'project' === get_post_type( $post_id ) ) { | |
$message = 'This project is part of your membership, but not yet! You will gain access on {date}'; | |
} | |
return $message; | |
} | |
add_filter( 'wc_memberships_get_content_delayed_message', 'sv_filter_content_delayed_message', 10, 3 ); |
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 | |
// Changes PayPal Digital Goods to "PayPal" in FreshBooks | |
// Can be used with any payment method ID | |
function wc_freshbooks_payment_type( $type, $payment_method ) { | |
if ( 'paypal_digital_goods' === $payment_method ) { | |
$type = 'PayPal'; | |
} | |
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
/* Improve Braintree checkout form */ | |
#wc_braintree_paypal_container { | |
height: 55px; | |
} | |
#payment .payment_methods li #wc_braintree_paypal_container img { | |
max-height: 5em; | |
} | |
#wc_braintree_paypal_container .paypal-button.paypal-style-checkout { |
OlderNewer