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

Commit

Permalink
Adds a hotfix for keeping the site title and email footer in sync. (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinshreve authored Jul 27, 2017
1 parent ee519cd commit d4eab10
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions hotfixes/wc-api-dev-email-site-title.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* WooCommerce has settings for email subject and footer, which defaults to the 'site title'.
* However, this can easily become out of sync. This uses the provided filters to always
* return the current site title.
*
* @since 0.8.0
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

function wc_api_dev_email_from_name( $name ) {
return get_bloginfo( 'name', 'display' );
}
add_filter( 'woocommerce_email_from_name', 'wc_api_dev_email_from_name' );

function wc_api_dev_email_footer_text( $text ) {
return sprintf( __( '%s - Powered by WooCommerce', 'woocommerce' ), get_bloginfo( 'name', 'display' ) );
}
add_filter( 'woocommerce_email_footer_text', 'wc_api_dev_email_footer_text' );
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This section describes how to install the plugin and get it working.

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

= 0.7.1 =
* Fix - add another URI to watch for when disabling sync during API requests
Expand Down
1 change: 1 addition & 0 deletions wc-api-dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public function includes() {

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

/**
Expand Down

0 comments on commit d4eab10

Please sign in to comment.