This file contains hidden or 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 | |
/** | |
* If the POST contains the first_name and last_name fields, add to the customer created through WooCommerce. | |
*/ | |
function my_woocommerce_new_customer_data( $new_customer_data ) { | |
if ( empty( $new_customer_data['first_name'] ) && isset( $_POST['first_name'] ) ) { | |
$new_customer_data['first_name'] = sanitize_text_field( $_POST['first_name'] ); | |
} | |
if ( empty( $new_customer_data['last_name'] ) && isset( $_POST['last_name'] ) ) { | |
$new_customer_data['last_name'] = sanitize_text_field( $_POST['last_name'] ); |
This file contains hidden or 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 widgets by widget area ID based on the user's membership level. | |
* Update the $hide_sidebars_array with the array of sidebar IDs you want to filter. | |
* Update the $show_for_levels_array with the array level IDs you want this sidebar visible for. | |
*/ | |
function my_pmpro_widget_display_by_level_id_callback( $instance, $widget, $args ) { | |
// Set an array of widget areas by ID to filter. | |
$hide_sidebars_array = array( 'sidebar-1', 'sidebar-2' ); |
This file contains hidden or 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
.pmpro-checkout .pmpro_form { | |
display: -ms-grid; | |
display: grid; | |
grid-column-gap: 1em; | |
-ms-grid-columns: 1 1em 1; | |
grid-template-columns: 1 1; | |
grid-template-areas: | |
"message message" | |
"pricing pricing" | |
"user address" |
This file contains hidden or 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
/* Method to show specific level options to specific members. */ | |
[membership level="1"] | |
[pmpro_advanced_levels levels="2,3,4"] | |
[/membership] | |
[membership level="2"] | |
[pmpro_advanced_levels levels="5,6,7"] | |
[/membership] |
This file contains hidden or 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
/* Use this with the recipe here: https://gist.github.com/kimcoleman/faf2cd0a83f3ca7a5c6c368e371ad1f3 */ | |
.pmpro_protected_post_featured_image { | |
position: relative; | |
overflow: hidden; | |
} | |
.pmpro_protected_post_featured_image img { | |
filter: grayscale(1) blur(5px); | |
} | |
.pmpro_protected_post_blur_mask { | |
-webkit-box-align: center; |
This file contains hidden or 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 the featured image and include an overlay if the post is protected. | |
* Use this with the recipe here: https://gist.github.com/kimcoleman/299bb458310e00d7282c090110c6b4f0 | |
* | |
* 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. | |
* | |
*/ | |
/** |
This file contains hidden or 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 season-specific class to the body tag. | |
* | |
*/ | |
function stranger_studios_season_body_class( $classes ) { | |
$months_winter = array( 1, 2, 11, 12 ); | |
if ( in_array( date( 'm' ), $months_winter ) ) { | |
$classes[] = 'body_winter'; | |
} |
This file contains hidden or 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 | |
/** Use the pmpro_default_country filter to pre-set the dropdown at checkout to your country of choice. | |
* | |
* 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. | |
* | |
*/ | |
function my_set_pmpro_default_country( $default_country ) { | |
// Set country code to "GB" for United Kingdom. | |
$default_country = "GB"; |