Skip to content

Instantly share code, notes, and snippets.

@JonasSkjodt
JonasSkjodt / bp-change-reply-email.php
Created January 12, 2020 21:19
Change reply to email in Buddypress emails from Wordpress admin email to custom email
<?php
add_filter( 'bp_email_set_reply_to', function( $retval ) {
return new BP_Email_Recipient( '[email protected]' );
} );
@JonasSkjodt
JonasSkjodt / add-media-file-in-wordpress-post-rss-feed.php
Last active January 12, 2020 21:20
Adding the Wordpress Post's media file to the RSS feed
<?php
// Add namespace for media:image element used below
add_filter( 'rss2_ns', function(){
echo 'xmlns:media="http://search.yahoo.com/mrss/"';
});
// insert the image object into the RSS item
add_action('rss2_item', function(){
global $post;
if (has_post_thumbnail($post->ID)){
<?php
// Add Downloadable Products to Woocommerce Completed Order & Invoice Emails as Attachments
add_filter( 'woocommerce_email_attachments', 'woocommerce_emails_attach_downloadables', 10, 3);
function woocommerce_emails_attach_downloadables($attachments, $status, $order) {
if ( ! is_object( $order ) || ! isset( $status ) ) {
return $attachments;
}
if ( empty( $order ) ) {
return $attachments;