PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.13.1
GiveWP – Donation Plugin and Fundraising Platform v2.13.1
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / includes / admin / setting-page-functions.php
setting-page-functions.php
82 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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