| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | * Give Settings Page/Tab |
| 4 | 4 | * |
| 5 | 5 | * @package Give |
| 6 | 6 | * @subpackage Classes/Give_Settings_Addon |
| 7 | - * @copyright Copyright (c) 2016, WordImpress | |
| 7 | + * @copyright Copyright (c) 2016, GiveWP | |
| 8 | 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | 9 | * @since 1.8 |
| 10 | 10 | */ |
| 11 | 11 | |
| @@ -41,9 +41,9 @@ | ||
| 41 | 41 | function set_default_setting_tab( $setting_tab ) { |
| 42 | 42 | $default_tab = ''; |
| 43 | 43 | |
| 44 | 44 | // Set default tab to first setting tab. |
| 45 | - if( $sections = array_keys( $this->get_sections() ) ) { | |
| 45 | + if ( $sections = array_keys( $this->get_sections() ) ) { | |
| 46 | 46 | $default_tab = current( $sections ); |
| 47 | 47 | } |
| 48 | 48 | return $default_tab; |
| 49 | 49 | } |
| @@ -55,11 +55,12 @@ | ||
| 55 | 55 | * @param array $pages Lst of pages. |
| 56 | 56 | * @return array |
| 57 | 57 | */ |
| 58 | 58 | public function add_settings_page( $pages ) { |
| 59 | - $setting = $this->get_settings(); | |
| 59 | + $sections = $this->get_sections(); | |
| 60 | + | |
| 60 | 61 | // Bailout: Do not add addons setting tab if it does not contain any setting fields. |
| 61 | - if( ! empty( $setting ) ) { | |
| 62 | + if ( ! empty( $sections ) ) { | |
| 62 | 63 | $pages[ $this->id ] = $this->label; |
| 63 | 64 | } |
| 64 | 65 | |
| 65 | 66 | return $pages; |