add-ons
5 years ago
donors
5 years ago
emails
6 years ago
forms
4 years ago
payments
4 years ago
reports
5 years ago
settings
4 years ago
shortcodes
5 years ago
tools
5 years ago
upgrades
5 years ago
views
6 years ago
abstract-admin-settings-page.php
6 years ago
admin-actions.php
5 years ago
admin-filters.php
6 years ago
admin-footer.php
5 years ago
admin-pages.php
5 years ago
class-addon-activation-banner.php
6 years ago
class-admin-settings.php
5 years ago
class-api-keys-table.php
6 years ago
class-blank-slate.php
6 years ago
class-give-admin.php
5 years ago
class-give-html-elements.php
6 years ago
class-i18n-module.php
6 years ago
dashboard-widgets.php
6 years ago
give-metabox-functions.php
5 years ago
import-functions.php
5 years ago
misc-functions.php
5 years ago
plugins.php
5 years ago
setting-page-functions.php
6 years ago
setting-page-functions.php
82 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Get current setting tab. |
| 4 | * |
| 5 | * @since 1.8 |
| 6 | * @return string |
| 7 | */ |
| 8 | function give_get_current_setting_tab() { |
| 9 | // Get current setting page. |
| 10 | $current_setting_page = give_get_current_setting_page(); |
| 11 | |
| 12 | /** |
| 13 | * Filter the default tab for current setting page. |
| 14 | * |
| 15 | * @since 1.8 |
| 16 | * |
| 17 | * @param string |
| 18 | */ |
| 19 | $default_current_tab = apply_filters( "give_default_setting_tab_{$current_setting_page}", 'general' ); |
| 20 | |
| 21 | // Get current tab. |
| 22 | $current_tab = empty( $_GET['tab'] ) ? $default_current_tab : urldecode( $_GET['tab'] ); |
| 23 | |
| 24 | // Output. |
| 25 | return $current_tab; |
| 26 | } |
| 27 | |
| 28 | |
| 29 | /** |
| 30 | * Get current setting section. |
| 31 | * |
| 32 | * @since 1.8 |
| 33 | * @return string |
| 34 | */ |
| 35 | function give_get_current_setting_section() { |
| 36 | // Get current tab. |
| 37 | $current_tab = give_get_current_setting_tab(); |
| 38 | |
| 39 | /** |
| 40 | * Filter the default section for current setting page tab. |
| 41 | * |
| 42 | * @since 1.8 |
| 43 | * |
| 44 | * @param string |
| 45 | */ |
| 46 | $default_current_section = apply_filters( "give_default_setting_tab_section_{$current_tab}", '' ); |
| 47 | |
| 48 | // Get current section. |
| 49 | $current_section = empty( $_REQUEST['section'] ) ? $default_current_section : urldecode( $_REQUEST['section'] ); |
| 50 | |
| 51 | // Output. |
| 52 | return $current_section; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Get current setting page. |
| 57 | * |
| 58 | * @since 1.8 |
| 59 | * @return string |
| 60 | */ |
| 61 | function give_get_current_setting_page() { |
| 62 | // Get current page. |
| 63 | $setting_page = ! empty( $_GET['page'] ) ? urldecode( $_GET['page'] ) : ''; |
| 64 | |
| 65 | // Output. |
| 66 | return $setting_page; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * This function will fetch all the groups of a current section. |
| 71 | * |
| 72 | * @since 2.5.5 |
| 73 | * |
| 74 | * @return array |
| 75 | */ |
| 76 | function give_get_settings_groups() { |
| 77 | |
| 78 | $current_section = give_get_current_setting_section(); |
| 79 | |
| 80 | return apply_filters( 'give_get_groups_' . $current_section, array() ); |
| 81 | } |
| 82 |