1 | <?php |
||
13 | class BD_Settings_Page { |
||
14 | /** |
||
15 | * Slug for settings page. |
||
16 | * |
||
17 | * @since 5.3 |
||
18 | */ |
||
19 | const SETTINGS_PAGE_SLUG = 'bd-settings'; |
||
20 | |||
21 | /** |
||
22 | * Slugs for addon settings. |
||
23 | * |
||
24 | * @since 5.3 |
||
25 | */ |
||
26 | const ADDON_SETTING_OPTION_GROUP = 'bd_addon_settings'; |
||
27 | const ADDON_SETTING_OPTION_NAME = 'bd_addon_settings'; |
||
28 | |||
29 | /** |
||
30 | * Add settings menu if needed. |
||
31 | * |
||
32 | * @static |
||
33 | * |
||
34 | * @since 5.3 |
||
35 | */ |
||
36 | public static function add_menu() { |
||
59 | ); |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * Sanitize Settings. |
||
64 | * |
||
65 | * @static |
||
66 | * |
||
67 | * @since 5.3 |
||
68 | * |
||
69 | * @param array $input (optional) Input array |
||
70 | * |
||
71 | * @return array Sanitized input |
||
72 | */ |
||
73 | public static function sanitize_settings( $input = array() ) { |
||
74 | return apply_filters( 'bd_sanitize_settings_page_fields', $input ); |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * Return Addon settings. |
||
79 | * |
||
80 | * @since 5.3 |
||
81 | * @static |
||
82 | * |
||
83 | * @return array Addon settings |
||
84 | */ |
||
85 | public static function get_addon_settings() { |
||
86 | $options = get_option( self::ADDON_SETTING_OPTION_NAME, array() ); |
||
87 | |||
88 | return apply_filters( 'bd_addon_settings', $options ); |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * Show the settings page. |
||
93 | * |
||
94 | * @static |
||
95 | * |
||
96 | * @since 5.3 |
||
97 | */ |
||
98 | public static function display_settings_page() { |
||
131 | } |
||
132 | } |
||
133 | |||
140 |