| @@ 8-26 (lines=19) @@ | ||
| 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 | /** |
|
| @@ 35-53 (lines=19) @@ | ||
| 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. |
|