id = 'addons'; $this->label = esc_html__( 'Add-ons', 'give' ); parent::__construct(); } /** * Default setting tab. * * @since 1.8 * @param $setting_tab * @return string */ function set_default_setting_tab( $setting_tab ) { $default_tab = ''; // Set default tab to first setting tab. if ( $sections = array_keys( $this->get_sections() ) ) { $default_tab = current( $sections ); } return $default_tab; } /** * Add this page to settings. * * @since 1.8 * @param array $pages Lst of pages. * @return array */ public function add_settings_page( $pages ) { $sections = $this->get_sections(); // Bailout: Do not add addons setting tab if it does not contain any setting fields. if ( ! empty( $sections ) ) { $pages[ $this->id ] = $this->label; } return $pages; } /** * Get settings array. * * @since 1.8 * @return array */ public function get_settings() { $settings = array(); /** * Filter the addons settings. * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 */ $settings = apply_filters( 'give_settings_addons', $settings ); /** * Filter the settings. * * @since 1.8 * @param array $settings */ $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); // Output. return $settings; } } endif; return new Give_Settings_Addon();