From 5845b37ca25f176f7e2b23124daf9986a170ce28 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 26 Jul 2012 15:11:29 +0100 Subject: [PATCH] settings api --- classes/class-wc-settings-api.php | 12 ++++++++---- classes/gateways/bacs/class-wc-bacs.php | 6 ++++++ readme.txt | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/classes/class-wc-settings-api.php b/classes/class-wc-settings-api.php index f3933068a05..5b1d60ec3ad 100644 --- a/classes/class-wc-settings-api.php +++ b/classes/class-wc-settings-api.php @@ -328,14 +328,18 @@ class WC_Settings_API { /** * Generate Title HTML. * - * @since 1.0.0 + * @since 1.6.2 * @return $html string */ - function generate_title_html ( $key, $data ) { + function generate_title_html( $key, $data ) { $html = ''; - + + if ( isset( $data['title'] ) && $data['title'] != '' ) $title = $data['title']; else $title = ''; + $data['class'] = (isset( $data['class'] )) ? $data['class'] : ''; + $data['css'] = (isset( $data['css'] )) ? $data['css'] : ''; + $html .= '' . "\n"; - $html .= '

' . $data['name'] . '

' . "\n"; + $html .= '

' . $data['title'] . '

' . "\n"; if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '

' . $data['description'] . '

' . "\n"; } $html .= '' . "\n"; diff --git a/classes/gateways/bacs/class-wc-bacs.php b/classes/gateways/bacs/class-wc-bacs.php index d021c12c5ee..31b0abf07a8 100644 --- a/classes/gateways/bacs/class-wc-bacs.php +++ b/classes/gateways/bacs/class-wc-bacs.php @@ -64,6 +64,12 @@ class WC_BACS extends WC_Payment_Gateway { 'description' => __( 'Give the customer instructions for paying via BACS, and let them know that their order won\'t be shipping until the money is received.', 'woocommerce' ), 'default' => __('Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order wont be shipped until the funds have cleared in our account.', 'woocommerce') ), + 'account_details' => array( + 'title' => __( 'Account Details', 'woocommerce' ), + 'type' => 'title', + 'description' => __( 'Optionally enter your bank details below for customers to pay into.', 'woocommerce' ), + 'default' => '' + ), 'account_name' => array( 'title' => __( 'Account Name', 'woocommerce' ), 'type' => 'text', diff --git a/readme.txt b/readme.txt index 60bec6cb014..5888e0434b2 100644 --- a/readme.txt +++ b/readme.txt @@ -163,6 +163,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Tweak - Added date to admin order notification * Tweak - Formatted addresses in emails in a table to maintain appearance when printing * Tweak - Better support for supercache - detect late_init or don't cache +* Tweak - Added generate_title_html() to settings API * Fix - Removed session_name from 1.6 to prevent issues when other plugins start a session first. Instead, added a KB article on how to do it manually (if needed, this is an edge case) - http://wcdocs.woothemes.com/codex/extending/multiple-installs-on-one-domain-sessions-conflictsession-sharing-workaround/ * Fix - Product categories shortcode loop * Fix - selected state for variation options