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 | |
/** | |
* Plugin Name: Enhanced WP Mail Attachments | |
* Plugin URI: https://gist.github.com/thomasfw/5df1a041fd8f9c939ef9d88d887ce023/ | |
* Version: 0.1 | |
*/ | |
/** | |
* Adds support for defining attachments as data arrays in wp_mail(). |
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
// Gutenberg Color Palette | |
// These are merged Bootstrap 4 $theme-colors from global variables. | |
// The compiled rules are also read and cached in 'functions.php' | |
// so they don't need to be registered manually. | |
$gutenberg-colors: map-merge( ( | |
'dark' : #1A1A1A, | |
'green' : #68b678, | |
'red' : #E2574D, | |
), $theme-colors ); |
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 // https://github.com/thomasfw | |
// Add to your functions.php, or somewhere else.. | |
// The 'rcp_set_expiration_date' hook is used instead of 'rcp_edit_member' so we can access the $old_date | |
add_action( 'rcp_set_expiration_date', 'my_update_stripe_billing_cycle', PHP_INT_MAX, 3 ); | |
function my_update_stripe_billing_cycle( $member_id, $new_date, $old_date ) | |
{ | |
// Check/verify we're in the edit_member form (given the limitations on error output, changing the expiry elsewhere will not fire the request to Stripe) | |
if( !isset($_POST['rcp_edit_member_nonce']) || !wp_verify_nonce( $_POST['rcp_edit_member_nonce'], 'rcp_edit_member_nonce' ) ) return; |