Skip to content
This repository was archived by the owner on Oct 4, 2019. It is now read-only.

Commit d4eab10

Browse files
author
Justin Shreve
authored
Adds a hotfix for keeping the site title and email footer in sync. (#32)
1 parent ee519cd commit d4eab10

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* WooCommerce has settings for email subject and footer, which defaults to the 'site title'.
4+
* However, this can easily become out of sync. This uses the provided filters to always
5+
* return the current site title.
6+
*
7+
* @since 0.8.0
8+
*/
9+
10+
if ( ! defined( 'ABSPATH' ) ) {
11+
exit;
12+
}
13+
14+
function wc_api_dev_email_from_name( $name ) {
15+
return get_bloginfo( 'name', 'display' );
16+
}
17+
add_filter( 'woocommerce_email_from_name', 'wc_api_dev_email_from_name' );
18+
19+
function wc_api_dev_email_footer_text( $text ) {
20+
return sprintf( __( '%s - Powered by WooCommerce', 'woocommerce' ), get_bloginfo( 'name', 'display' ) );
21+
}
22+
add_filter( 'woocommerce_email_footer_text', 'wc_api_dev_email_footer_text' );

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This section describes how to install the plugin and get it working.
2727

2828
= 0.8.0 =
2929
* Update orders endpoint to accept multiple statuses
30+
* Fix - Email subject and footers becoming out of sync
3031

3132
= 0.7.1 =
3233
* Fix - add another URI to watch for when disabling sync during API requests

wc-api-dev.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public function includes() {
120120

121121
// Things that aren't related to a specific endpoint but to things like cross-plugin compatibility
122122
include_once( dirname( __FILE__ ) . '/hotfixes/wc-api-dev-jetpack-hotfixes.php' );
123+
include_once( dirname( __FILE__ ) . '/hotfixes/wc-api-dev-email-site-title.php' );
123124
}
124125

125126
/**

0 commit comments

Comments
 (0)