PluginProbe
WpStream – Live Streaming, Video on Demand, Pay Per View / 4.14.1
WpStream – Live Streaming, Video on Demand, Pay Per View v4.14.1
4.14.1 4.14.0 4.13.2 4.13.1 4.13 4.12.5 4.12.4 4.12.3 4.12.2 4.12.1 4.12 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5 4.5.1 4.5.11 4.5.11.1 4.5.11.2 4.5.11.4 4.5.11.5 4.5.11.6 All 181 releases
wpstream / hello-wpstream / framework / options / theme-options.php

theme-options.php in WpStream – Live Streaming, Video on Demand, Pay Per View 4.14.1, at hello-wpstream/framework/options/theme-options.php

401 lines 11.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Theme options
4 *
5 * Bootstraps the Redux Framework options panel for the hello-wpstream theme.
6 * Defines the shared option-set name, the global country list and the allowed
7 * HTML whitelist, wires up Redux args (admin bar links, share icons), disables
8 * Redux demo mode, and exposes the wpstream_return_option() accessor used
9 * throughout the theme to read saved option values.
10 *
11 * @package wpstream-theme
12 */
13
14
15 // Exit if accessed directly.
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit;
18 }
19
20 // Redux must be available; if the framework is not loaded, skip this file entirely.
21 if ( ! class_exists( 'Redux' ) ) {
22 return;
23 }
24
25 // Shared globals: option-set name, country dropdown source, and the kses whitelist.
26 global $wpstream_opt_name, $country_list, $allowed_html_array;
27
28 // Whitelist of HTML tags/attributes allowed when sanitizing rich option text.
29 $allowed_html_array = array(
30 'i' => array(
31 'class' => array(),
32 ),
33 'span' => array(
34 'class' => array(),
35 ),
36 'a' => array(
37 'href' => array(),
38 'title' => array(),
39 'target' => array(),
40 ),
41 );
42
43 // This is your option name where all the Redux data is stored.
44 $wpstream_opt_name = 'wpstream_options';
45
46 // This line is only for altering the demo. Can be easily removed.
47 $wpstream_opt_name = apply_filters( 'redux_demo_opt_name', $wpstream_opt_name );
48 $redux_path = ReduxFramework::$_dir; // Filesystem path to the Redux framework.
49 $redux_url = ReduxFramework::$_url; // URL to the Redux framework assets.
50 $img_url = $redux_url . 'assets/img/'; // Base URL for bundled Redux images.
51 $theme = wp_get_theme(); // For use with some settings. Not necessary.
52 $theme_name = $theme->get( 'Name' ); // Active theme name, available for labels.
53
54 // ADMIN BAR LINKS -> Setup custom links in the admin bar menu as external items.
55 // Add a "Support" link pointing at wpstream.net into the Redux admin bar menu.
56 $args['admin_bar_links'][] = array(
57 'id' => 'wpstream-support',
58 'href' => 'https://wpstream.net',
59 'title' => esc_html__( 'Support', 'hello-wpstream' ),
60 );
61
62 // Share icon: Facebook (URL left blank for the site owner to fill in).
63 $args['share_icons'][] = array(
64 'url' => '',
65 'title' => 'Like us on Facebook',
66 'icon' => 'el el-facebook',
67 );
68
69 // Share icon: Twitter (URL left blank for the site owner to fill in).
70 $args['share_icons'][] = array(
71 'url' => '',
72 'title' => 'Follow us on Twitter',
73 'icon' => 'el el-twitter',
74 );
75
76 // Apply the assembled args to the Redux option set.
77 Redux::setArgs( $wpstream_opt_name, $args );
78
79 // Change the arguments after they've been declared, but before the panel is created.
80 add_filter( 'redux/options/' . $wpstream_opt_name . '/args', 'change_arguments' );
81
82 // If Redux is running as a plugin, this will remove the demo notice and links.
83 add_action( 'redux/loaded', 'remove_demo' );
84
85 /**
86 * Filter hook for filtering the args. Good for child themes to override or add to the args array. Can also be used in other functions.
87 * */
88 if ( ! function_exists( 'change_arguments' ) ) {
89 /**
90 * Changes the arguments by adding or modifying specific parameters.
91 *
92 * @param array $args The original arguments.
93 * @return array The modified arguments.
94 */
95 function change_arguments( $args ) {
96 // Force Redux developer mode off in this theme.
97 $args['dev_mode'] = false;
98
99 // Return the modified args back to Redux.
100 return $args;
101 }
102 }
103
104 /**
105 * Removes the demo link and the notice of integrated demo from the redux-framework plugin
106 */
107 if ( ! function_exists( 'remove_demo' ) ) {
108 /**
109 * Remove demo
110 */
111 function remove_demo() {
112 // Used to hide the demo mode link from the plugin page. Only used when Redux is a plugin.
113 // Only act when Redux is present as a standalone plugin.
114 if ( class_exists( 'ReduxFrameworkPlugin' ) ) {
115 // Remove the demo-mode link that Redux adds to the plugin row meta.
116 remove_filter(
117 'plugin_row_meta',
118 array(
119 ReduxFrameworkPlugin::instance(),
120 'plugin_metalinks',
121 ),
122 null,
123 2
124 );
125 // Used to hide the activation notice informing users of the demo panel. Only used when Redux is a plugin.
126 remove_action( 'admin_notices', array( ReduxFrameworkPlugin::instance(), 'admin_notices' ) );
127 }
128 }
129 }
130
131 if ( ! function_exists( 'wpstream_return_option' ) ) {
132 /**
133 * Returns the value of a specified option from the 'wpstream_options' settings.
134 *
135 * @param string $opt_name The name of the option.
136 * @param mixed $is_default (Optional) The default value to return if the option does not exist.
137 * @return mixed The value of the option if it exists, otherwise the default value.
138 */
139 function wpstream_return_option( $opt_name, $is_default = null ) {
140 // Load the full saved Redux option array.
141 $wpstream_option = get_option( 'wpstream_options' );
142
143 // Return the requested key if present, otherwise the supplied default.
144 $option_val = isset( $wpstream_option[ $opt_name ] ) ? $wpstream_option[ $opt_name ] : $is_default;
145 return $option_val;
146 }
147 }
148
149 // Country code => display name map, exposed globally for country dropdown fields.
150 $country_list = array(
151 'US' => 'United States',
152 'CA' => 'Canada',
153 'AU' => 'Australia',
154 'FR' => 'France',
155 'DE' => 'Germany',
156 'IS' => 'Iceland',
157 'IE' => 'Ireland',
158 'IT' => 'Italy',
159 'ES' => 'Spain',
160 'SE' => 'Sweden',
161 'AT' => 'Austria',
162 'BE' => 'Belgium',
163 'FI' => 'Finland',
164 'CZ' => 'Czech Republic',
165 'DK' => 'Denmark',
166 'NO' => 'Norway',
167 'GB' => 'United Kingdom',
168 'CH' => 'Switzerland',
169 'NZ' => 'New Zealand',
170 'RU' => 'Russian Federation',
171 'PT' => 'Portugal',
172 'NL' => 'Netherlands',
173 'IM' => 'Isle of Man',
174 'AF' => 'Afghanistan',
175 'AX' => 'Aland Islands ',
176 'AL' => 'Albania',
177 'DZ' => 'Algeria',
178 'AS' => 'American Samoa',
179 'AD' => 'Andorra',
180 'AO' => 'Angola',
181 'AI' => 'Anguilla',
182 'AQ' => 'Antarctica',
183 'AG' => 'Antigua and Barbuda',
184 'AR' => 'Argentina',
185 'AM' => 'Armenia',
186 'AW' => 'Aruba',
187 'AZ' => 'Azerbaijan',
188 'BS' => 'Bahamas',
189 'BH' => 'Bahrain',
190 'BD' => 'Bangladesh',
191 'BB' => 'Barbados',
192 'BY' => 'Belarus',
193 'BZ' => 'Belize',
194 'BJ' => 'Benin',
195 'BM' => 'Bermuda',
196 'BT' => 'Bhutan',
197 'BO' => 'Bolivia, Plurinational State of',
198 'BQ' => 'Bonaire, Sint Eustatius and Saba',
199 'BA' => 'Bosnia and Herzegovina',
200 'BW' => 'Botswana',
201 'BV' => 'Bouvet Island',
202 'BR' => 'Brazil',
203 'IO' => 'British Indian Ocean Territory',
204 'BN' => 'Brunei Darussalam',
205 'BG' => 'Bulgaria',
206 'BF' => 'Burkina Faso',
207 'BI' => 'Burundi',
208 'KH' => 'Cambodia',
209 'CM' => 'Cameroon',
210 'CV' => 'Cape Verde',
211 'KY' => 'Cayman Islands',
212 'CF' => 'Central African Republic',
213 'TD' => 'Chad',
214 'CL' => 'Chile',
215 'CN' => 'China',
216 'CX' => 'Christmas Island',
217 'CC' => 'Cocos (Keeling) Islands',
218 'CO' => 'Colombia',
219 'KM' => 'Comoros',
220 'CG' => 'Congo',
221 'CD' => 'Congo, the Democratic Republic of the',
222 'CK' => 'Cook Islands',
223 'CR' => 'Costa Rica',
224 'CI' => 'Cote d\'Ivoire',
225 'HR' => 'Croatia',
226 'CU' => 'Cuba',
227 'CW' => 'Curaçao',
228 'CY' => 'Cyprus',
229 'DJ' => 'Djibouti',
230 'DM' => 'Dominica',
231 'DO' => 'Dominican Republic',
232 'EC' => 'Ecuador',
233 'EG' => 'Egypt',
234 'SV' => 'El Salvador',
235 'GQ' => 'Equatorial Guinea',
236 'ER' => 'Eritrea',
237 'EE' => 'Estonia',
238 'ET' => 'Ethiopia',
239 'FK' => 'Falkland Islands (Malvinas)',
240 'FO' => 'Faroe Islands',
241 'FJ' => 'Fiji',
242 'GF' => 'French Guiana',
243 'PF' => 'French Polynesia',
244 'TF' => 'French Southern Territories',
245 'GA' => 'Gabon',
246 'GM' => 'Gambia',
247 'GE' => 'Georgia',
248 'GH' => 'Ghana',
249 'GI' => 'Gibraltar',
250 'GR' => 'Greece',
251 'GL' => 'Greenland',
252 'GD' => 'Grenada',
253 'GP' => 'Guadeloupe',
254 'GU' => 'Guam',
255 'GT' => 'Guatemala',
256 'GG' => 'Guernsey',
257 'GN' => 'Guinea',
258 'GW' => 'Guinea-Bissau',
259 'GY' => 'Guyana',
260 'HT' => 'Haiti',
261 'HM' => 'Heard Island and McDonald Islands',
262 'VA' => 'Holy See (Vatican City State)',
263 'HN' => 'Honduras',
264 'HK' => 'Hong Kong',
265 'HU' => 'Hungary',
266 'IN' => 'India',
267 'ID' => 'Indonesia',
268 'IR' => 'Iran, Islamic Republic of',
269 'IQ' => 'Iraq',
270 'IL' => 'Israel',
271 'JM' => 'Jamaica',
272 'JP' => 'Japan',
273 'JE' => 'Jersey',
274 'JO' => 'Jordan',
275 'KZ' => 'Kazakhstan',
276 'KE' => 'Kenya',
277 'KI' => 'Kiribati',
278 'KP' => 'Korea, Democratic People\'s Republic of',
279 'KR' => 'Korea, Republic of',
280 'KV' => 'kosovo',
281 'KW' => 'Kuwait',
282 'KG' => 'Kyrgyzstan',
283 'LA' => 'Lao People\'s Democratic Republic',
284 'LV' => 'Latvia',
285 'LB' => 'Lebanon',
286 'LS' => 'Lesotho',
287 'LR' => 'Liberia',
288 'LY' => 'Libyan Arab Jamahiriya',
289 'LI' => 'Liechtenstein',
290 'LT' => 'Lithuania',
291 'LU' => 'Luxembourg',
292 'MO' => 'Macao',
293 'MK' => 'Macedonia',
294 'MG' => 'Madagascar',
295 'MW' => 'Malawi',
296 'MY' => 'Malaysia',
297 'MV' => 'Maldives',
298 'ML' => 'Mali',
299 'MT' => 'Malta',
300 'MH' => 'Marshall Islands',
301 'MQ' => 'Martinique',
302 'MR' => 'Mauritania',
303 'MU' => 'Mauritius',
304 'YT' => 'Mayotte',
305 'MX' => 'Mexico',
306 'FM' => 'Micronesia, Federated States of',
307 'MD' => 'Moldova, Republic of',
308 'MC' => 'Monaco',
309 'MN' => 'Mongolia',
310 'ME' => 'Montenegro',
311 'MS' => 'Montserrat',
312 'MA' => 'Morocco',
313 'MZ' => 'Mozambique',
314 'MM' => 'Myanmar',
315 'NA' => 'Namibia',
316 'NR' => 'Nauru',
317 'NP' => 'Nepal',
318 'NC' => 'New Caledonia',
319 'NI' => 'Nicaragua',
320 'NE' => 'Niger',
321 'NG' => 'Nigeria',
322 'NU' => 'Niue',
323 'NF' => 'Norfolk Island',
324 'MP' => 'Northern Mariana Islands',
325 'OM' => 'Oman',
326 'PK' => 'Pakistan',
327 'PW' => 'Palau',
328 'PS' => 'Palestinian Territory, Occupied',
329 'PA' => 'Panama',
330 'PG' => 'Papua New Guinea',
331 'PY' => 'Paraguay',
332 'PE' => 'Peru',
333 'PH' => 'Philippines',
334 'PN' => 'Pitcairn',
335 'PL' => 'Poland',
336 'PR' => 'Puerto Rico',
337 'QA' => 'Qatar',
338 'RE' => 'Reunion',
339 'RO' => 'Romania',
340 'RW' => 'Rwanda',
341 'BL' => 'Saint Barthélemy',
342 'SH' => 'Saint Helena',
343 'KN' => 'Saint Kitts and Nevis',
344 'LC' => 'Saint Lucia',
345 'MF' => 'Saint Martin (French part)',
346 'PM' => 'Saint Pierre and Miquelon',
347 'VC' => 'Saint Vincent and the Grenadines',
348 'WS' => 'Samoa',
349 'SM' => 'San Marino',
350 'ST' => 'Sao Tome and Principe',
351 'SA' => 'Saudi Arabia',
352 'SN' => 'Senegal',
353 'RS' => 'Serbia',
354 'SC' => 'Seychelles',
355 'SL' => 'Sierra Leone',
356 'SG' => 'Singapore',
357 'SX' => 'Sint Maarten (Dutch part)',
358 'SK' => 'Slovakia',
359 'SI' => 'Slovenia',
360 'SB' => 'Solomon Islands',
361 'SO' => 'Somalia',
362 'ZA' => 'South Africa',
363 'GS' => 'South Georgia and the South Sandwich Islands',
364 'LK' => 'Sri Lanka',
365 'SD' => 'Sudan',
366 'SR' => 'Suriname',
367 'SJ' => 'Svalbard and Jan Mayen',
368 'SZ' => 'Swaziland',
369 'SY' => 'Syrian Arab Republic',
370 'TW' => 'Taiwan, Province of China',
371 'TJ' => 'Tajikistan',
372 'TZ' => 'Tanzania, United Republic of',
373 'TH' => 'Thailand',
374 'TL' => 'Timor-Leste',
375 'TG' => 'Togo',
376 'TK' => 'Tokelau',
377 'TO' => 'Tonga',
378 'TT' => 'Trinidad and Tobago',
379 'TN' => 'Tunisia',
380 'TR' => 'Turkey',
381 'TM' => 'Turkmenistan',
382 'TC' => 'Turks and Caicos Islands',
383 'TV' => 'Tuvalu',
384 'UG' => 'Uganda',
385 'UA' => 'Ukraine',
386 'UAE' => 'United Arab Emirates',
387 'UM' => 'United States Minor Outlying Islands',
388 'UY' => 'Uruguay',
389 'UZ' => 'Uzbekistan',
390 'VU' => 'Vanuatu',
391 'VE' => 'Venezuela, Bolivarian Republic of',
392 'VN' => 'Viet Nam',
393 'VG' => 'Virgin Islands, British',
394 'VI' => 'Virgin Islands, U.S.',
395 'WF' => 'Wallis and Futuna',
396 'EH' => 'Western Sahara',
397 'YE' => 'Yemen',
398 'ZM' => 'Zambia',
399 'ZW' => 'Zimbabwe',
400 );
401