| @@ 1302-1320 (lines=19) @@ | ||
| 1299 | * @since 1.8 |
|
| 1300 | * @return string |
|
| 1301 | */ |
|
| 1302 | function give_get_current_setting_tab() { |
|
| 1303 | // Get current setting page. |
|
| 1304 | $current_setting_page = give_get_current_setting_page(); |
|
| 1305 | ||
| 1306 | /** |
|
| 1307 | * Filter the default tab for current setting page. |
|
| 1308 | * |
|
| 1309 | * @since 1.8 |
|
| 1310 | * |
|
| 1311 | * @param string |
|
| 1312 | */ |
|
| 1313 | $default_current_tab = apply_filters( "give_default_setting_tab_{$current_setting_page}", 'general' ); |
|
| 1314 | ||
| 1315 | // Get current tab. |
|
| 1316 | $current_tab = empty( $_GET['tab'] ) ? $default_current_tab : urldecode( $_GET['tab'] ); |
|
| 1317 | ||
| 1318 | // Output. |
|
| 1319 | return $current_tab; |
|
| 1320 | } |
|
| 1321 | ||
| 1322 | ||
| 1323 | /** |
|
| @@ 1329-1347 (lines=19) @@ | ||
| 1326 | * @since 1.8 |
|
| 1327 | * @return string |
|
| 1328 | */ |
|
| 1329 | function give_get_current_setting_section() { |
|
| 1330 | // Get current tab. |
|
| 1331 | $current_tab = give_get_current_setting_tab(); |
|
| 1332 | ||
| 1333 | /** |
|
| 1334 | * Filter the default section for current setting page tab. |
|
| 1335 | * |
|
| 1336 | * @since 1.8 |
|
| 1337 | * |
|
| 1338 | * @param string |
|
| 1339 | */ |
|
| 1340 | $default_current_section = apply_filters( "give_default_setting_tab_section_{$current_tab}", '' ); |
|
| 1341 | ||
| 1342 | // Get current section. |
|
| 1343 | $current_section = empty( $_REQUEST['section'] ) ? $default_current_section : urldecode( $_REQUEST['section'] ); |
|
| 1344 | ||
| 1345 | // Output. |
|
| 1346 | return $current_section; |
|
| 1347 | } |
|
| 1348 | ||
| 1349 | /** |
|
| 1350 | * Get current setting page. |
|