@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | * |
| 453 | 453 | * @deprecated 4.0.0 |
| 454 | 454 | */ |
| 455 | - public static bool $_as_plugin = false; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 455 | + public static bool $_as_plugin = false; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 456 | 456 | |
| 457 | 457 | /** |
| 458 | 458 | * Deprecated shim for v3 as plugin check. |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | * |
| 462 | 462 | * @deprecated 4.0.0 |
| 463 | 463 | */ |
| 464 | - public static bool $_is_plugin = false; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 464 | + public static bool $_is_plugin = false; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 465 | 465 | |
| 466 | 466 | /** |
| 467 | 467 | * Cloning is forbidden. |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | return; |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | - if ( ! isset( Redux::$init[ $args['opt_name'] ] ) ) { |
|
| 510 | + if ( ! isset( Redux::$init[$args['opt_name']] ) ) { |
|
| 511 | 511 | // Let's go back to the Redux API instead of having it run directly. |
| 512 | 512 | Redux_Functions_Ex::record_caller( $args['opt_name'] ); |
| 513 | 513 | Redux::set_args( $args['opt_name'], $args ); |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | $sections = Redux::construct_sections( $args['opt_name'] ); |
| 518 | 518 | $args = Redux::construct_args( $args['opt_name'] ); |
| 519 | 519 | Redux::set_defaults( $args['opt_name'] ); |
| 520 | - Redux::$init[ $args['opt_name'] ] = 1; |
|
| 520 | + Redux::$init[$args['opt_name']] = 1; |
|
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | $args = new Redux_Args( $this, $args ); |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | * @return mixed |
| 914 | 914 | */ |
| 915 | 915 | public function get( string $opt_name, $defaults = null ) { |
| 916 | - return ( ! empty( $this->options[ $opt_name ] ) ) ? $this->options[ $opt_name ] : $this->options_class->get_default( $opt_name, $defaults ); |
|
| 916 | + return ( ! empty( $this->options[$opt_name] ) ) ? $this->options[$opt_name] : $this->options_class->get_default( $opt_name, $defaults ); |
|
| 917 | 917 | } |
| 918 | 918 | |
| 919 | 919 | /** |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | */ |
| 930 | 930 | public function set( string $opt_name = '', $values = array() ) { |
| 931 | 931 | if ( ! empty( $opt_name ) && is_array( $values ) ) { |
| 932 | - $this->options[ $opt_name ] = $values; |
|
| 932 | + $this->options[$opt_name] = $values; |
|
| 933 | 933 | $this->options_class->set( $values ); |
| 934 | 934 | } |
| 935 | 935 | } |
@@ -39,854 +39,854 @@ |
||
| 39 | 39 | // Don't duplicate me! |
| 40 | 40 | if ( ! class_exists( 'ReduxFramework', false ) ) { |
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * Main ReduxFramework class |
|
| 44 | - * |
|
| 45 | - * @since 1.0.0 |
|
| 46 | - */ |
|
| 47 | - class ReduxFramework { |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * ReduxFramework instance storage. |
|
| 51 | - * |
|
| 52 | - * @var null|ReduxFramework |
|
| 53 | - * @access public |
|
| 54 | - */ |
|
| 55 | - public static ?ReduxFramework $instance; |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * Redux current version. |
|
| 59 | - * |
|
| 60 | - * @var string |
|
| 61 | - * @access public |
|
| 62 | - * |
|
| 63 | - * @deprecated 4.0.0 |
|
| 64 | - */ |
|
| 65 | - public static string $_version = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * Absolute directory of the Redux instance. |
|
| 69 | - * |
|
| 70 | - * @var string |
|
| 71 | - * @access public |
|
| 72 | - * |
|
| 73 | - * @deprecated 4.0.0 |
|
| 74 | - */ |
|
| 75 | - public static string $_dir = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * Full URL of the Redux instance. |
|
| 79 | - * |
|
| 80 | - * @var string |
|
| 81 | - * @access public |
|
| 82 | - * |
|
| 83 | - * @deprecated 4.0.0 |
|
| 84 | - */ |
|
| 85 | - public static string $_url = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * Current WordPress upload directory. |
|
| 89 | - * |
|
| 90 | - * @var string |
|
| 91 | - * @access public |
|
| 92 | - * |
|
| 93 | - * @deprecated 4.0.0 |
|
| 94 | - */ |
|
| 95 | - public static string $_upload_dir = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 96 | - |
|
| 97 | - /** |
|
| 98 | - * Current WordPress upload URL |
|
| 99 | - * |
|
| 100 | - * @var string |
|
| 101 | - * @access public |
|
| 102 | - * |
|
| 103 | - * @deprecated 4.0.0 |
|
| 104 | - */ |
|
| 105 | - public static string $_upload_url; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Init |
|
| 109 | - * |
|
| 110 | - * Backward compatibility for previous versions of Redux. |
|
| 111 | - */ |
|
| 112 | - public static function init() { |
|
| 113 | - |
|
| 114 | - // Backward compatibility for extensions. |
|
| 115 | - self::$_version = Redux_Core::$version; |
|
| 116 | - self::$_dir = Redux_Core::$dir; |
|
| 117 | - self::$_url = Redux_Core::$url; |
|
| 118 | - self::$_upload_dir = Redux_Core::$upload_dir; |
|
| 119 | - self::$_upload_url = Redux_Core::$upload_url; |
|
| 120 | - self::$_as_plugin = Redux_Core::$as_plugin; |
|
| 121 | - self::$_is_plugin = Redux_Core::$is_plugin; |
|
| 122 | - } |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * Array of field arrays. |
|
| 126 | - * |
|
| 127 | - * @var null|array |
|
| 128 | - */ |
|
| 129 | - public ?array $fields = array(); |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * Array of field sections. |
|
| 133 | - * |
|
| 134 | - * @var null|array |
|
| 135 | - */ |
|
| 136 | - public ?array $field_sections = array(); |
|
| 137 | - |
|
| 138 | - /** |
|
| 139 | - * Array of field types. |
|
| 140 | - * |
|
| 141 | - * @var null|array |
|
| 142 | - */ |
|
| 143 | - public ?array $field_types = array(); |
|
| 144 | - |
|
| 145 | - /** |
|
| 146 | - * Array of field heads. |
|
| 147 | - * |
|
| 148 | - * @var null|array |
|
| 149 | - */ |
|
| 150 | - public ?array $field_head = array(); |
|
| 151 | - |
|
| 152 | - /** |
|
| 153 | - * Array of extensions by type used in the panel. |
|
| 154 | - * |
|
| 155 | - * @var null|array |
|
| 156 | - */ |
|
| 157 | - public ?array $extensions = array(); |
|
| 158 | - |
|
| 159 | - /** |
|
| 160 | - * Array of sections and fields arrays. |
|
| 161 | - * |
|
| 162 | - * @var null|array |
|
| 163 | - */ |
|
| 164 | - public ?array $sections = array(); |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * Array of generated errors from the panel for localization. |
|
| 168 | - * |
|
| 169 | - * @var null|array |
|
| 170 | - */ |
|
| 171 | - public ?array $errors = array(); |
|
| 172 | - |
|
| 173 | - /** |
|
| 174 | - * Array of generated warnings from the panel for localization. |
|
| 175 | - * |
|
| 176 | - * @var null|array |
|
| 177 | - */ |
|
| 178 | - public ?array $warnings = array(); |
|
| 179 | - |
|
| 180 | - /** |
|
| 181 | - * Array of generated sanitize notices from the panel for localization. |
|
| 182 | - * |
|
| 183 | - * @var null|array |
|
| 184 | - */ |
|
| 185 | - public ?array $sanitize = array(); |
|
| 186 | - |
|
| 187 | - /** |
|
| 188 | - * Array of current option values. |
|
| 189 | - * |
|
| 190 | - * @var null|array |
|
| 191 | - */ |
|
| 192 | - public ?array $options = array(); |
|
| 193 | - |
|
| 194 | - /** |
|
| 195 | - * Array of option defaults. |
|
| 196 | - * |
|
| 197 | - * @var null|array |
|
| 198 | - */ |
|
| 199 | - public ?array $options_defaults = null; |
|
| 200 | - |
|
| 201 | - /** |
|
| 202 | - * Array of fields set to trigger the compiler hook. |
|
| 203 | - * |
|
| 204 | - * @var null|array |
|
| 205 | - */ |
|
| 206 | - public ?array $compiler_fields = array(); |
|
| 207 | - |
|
| 208 | - /** |
|
| 209 | - * Array of fields with CSS output selectors. |
|
| 210 | - * |
|
| 211 | - * @var null|array |
|
| 212 | - */ |
|
| 213 | - public ?array $output = array(); |
|
| 214 | - |
|
| 215 | - /** |
|
| 216 | - * Autogenerated CSS appended to the header (snake case maintained for backward compatibility). |
|
| 217 | - * |
|
| 218 | - * @var null|string |
|
| 219 | - */ |
|
| 220 | - public ?string $outputCSS = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName |
|
| 221 | - |
|
| 222 | - /** |
|
| 223 | - * Autogenerated variables appended to dynamic output. |
|
| 224 | - * |
|
| 225 | - * @var null|array |
|
| 226 | - */ |
|
| 227 | - public ?array $output_variables = array(); |
|
| 228 | - |
|
| 229 | - /** |
|
| 230 | - * CSS sent to the compiler hook (snake case maintained for backward compatibility). |
|
| 231 | - * |
|
| 232 | - * @var null|string |
|
| 233 | - */ |
|
| 234 | - public ?string $compilerCSS = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName |
|
| 235 | - |
|
| 236 | - /** |
|
| 237 | - * Array of global arguments. |
|
| 238 | - * |
|
| 239 | - * @var array|null |
|
| 240 | - */ |
|
| 241 | - public ?array $args = array(); |
|
| 242 | - |
|
| 243 | - /** |
|
| 244 | - * Used in customizer hooks. |
|
| 245 | - * |
|
| 246 | - * @var null|string |
|
| 247 | - */ |
|
| 248 | - public ?string $old_opt_name = ''; |
|
| 249 | - |
|
| 250 | - /** |
|
| 251 | - * Pointer to the Redux_Options_Default class. |
|
| 252 | - * |
|
| 253 | - * @var null|Redux_Options_Defaults |
|
| 254 | - */ |
|
| 255 | - public ?Redux_Options_Defaults $options_defaults_class = null; |
|
| 256 | - |
|
| 257 | - /** |
|
| 258 | - * Pointer to the Redux_Options class. |
|
| 259 | - * |
|
| 260 | - * @var null|Redux_Options_Constructor |
|
| 261 | - */ |
|
| 262 | - public ?Redux_Options_Constructor $options_class = null; |
|
| 263 | - |
|
| 264 | - /** |
|
| 265 | - * Pointer to the Redux_Required class |
|
| 266 | - * |
|
| 267 | - * @var null|Redux_Required |
|
| 268 | - */ |
|
| 269 | - public ?Redux_Required $required_class = null; |
|
| 270 | - |
|
| 271 | - /** |
|
| 272 | - * Pointer to the Redux_Output class. |
|
| 273 | - * |
|
| 274 | - * @var null|Redux_Output |
|
| 275 | - */ |
|
| 276 | - public ?Redux_Output $output_class = null; |
|
| 277 | - |
|
| 278 | - /** |
|
| 279 | - * Pointer to the Redux_Page_Render class. |
|
| 280 | - * |
|
| 281 | - * @var null|Redux_Page_Render |
|
| 282 | - */ |
|
| 283 | - public ?Redux_Page_Render $render_class = null; |
|
| 284 | - |
|
| 285 | - /** |
|
| 286 | - * Pointer to the Redux_Enqueue class. |
|
| 287 | - * |
|
| 288 | - * @var null|Redux_Enqueue |
|
| 289 | - */ |
|
| 290 | - public ?Redux_Enqueue $enqueue_class = null; |
|
| 291 | - |
|
| 292 | - /** |
|
| 293 | - * Pointer to the Redux_Transients class. |
|
| 294 | - * |
|
| 295 | - * @var null|Redux_Transients |
|
| 296 | - */ |
|
| 297 | - public ?Redux_Transients $transient_class = null; |
|
| 298 | - |
|
| 299 | - /** |
|
| 300 | - * Pointer to the Redux_wordPress_Data class. |
|
| 301 | - * |
|
| 302 | - * @var null|Redux_WordPress_Data |
|
| 303 | - */ |
|
| 304 | - public ?Redux_WordPress_Data $wordpress_data = null; |
|
| 305 | - |
|
| 306 | - /** |
|
| 307 | - * Pointer to the Redux_Validation class. |
|
| 308 | - * |
|
| 309 | - * @var null|Redux_Validation |
|
| 310 | - */ |
|
| 311 | - public ?Redux_Validation $validate_class = null; |
|
| 312 | - |
|
| 313 | - /** |
|
| 314 | - * Pointer to the Redux_Sanitize class. |
|
| 315 | - * |
|
| 316 | - * @var null|Redux_Sanitize |
|
| 317 | - */ |
|
| 318 | - public ?Redux_Sanitize $sanitize_class = null; |
|
| 319 | - |
|
| 320 | - /** |
|
| 321 | - * Pointer to the Redux_Args class. |
|
| 322 | - * |
|
| 323 | - * @var null|Redux_Args |
|
| 324 | - */ |
|
| 325 | - public ?Redux_Args $args_class = null; |
|
| 326 | - |
|
| 327 | - /** |
|
| 328 | - * Array of active transients used by Redux. |
|
| 329 | - * |
|
| 330 | - * @var null|mixed |
|
| 331 | - */ |
|
| 332 | - public $transients = array(); |
|
| 333 | - |
|
| 334 | - /** |
|
| 335 | - * Array of localized repeater data. |
|
| 336 | - * |
|
| 337 | - * @var null|array |
|
| 338 | - */ |
|
| 339 | - public ?array $repeater_data = array(); |
|
| 340 | - |
|
| 341 | - /** |
|
| 342 | - * Array of localized data. |
|
| 343 | - * |
|
| 344 | - * @var null|array |
|
| 345 | - */ |
|
| 346 | - public ?array $localize_data = array(); |
|
| 347 | - |
|
| 348 | - /** |
|
| 349 | - * Array of checked transients used by Redux. |
|
| 350 | - * |
|
| 351 | - * @var null|mixed |
|
| 352 | - */ |
|
| 353 | - public $transients_check = array(); |
|
| 354 | - |
|
| 355 | - /** |
|
| 356 | - * Never save to DB flag for metaboxes. |
|
| 357 | - * |
|
| 358 | - * @var bool |
|
| 359 | - */ |
|
| 360 | - public bool $never_save_to_db; |
|
| 361 | - |
|
| 362 | - /** |
|
| 363 | - * File system object used for I/O file operations. Done the WordPress way. |
|
| 364 | - * |
|
| 365 | - * @var null|object |
|
| 366 | - * |
|
| 367 | - * @deprecated 4.5.1 |
|
| 368 | - */ |
|
| 369 | - public ?object $filesystem; |
|
| 370 | - |
|
| 371 | - /** |
|
| 372 | - * Deprecated shim for v3 templates. |
|
| 373 | - * |
|
| 374 | - * @var null|array |
|
| 375 | - * |
|
| 376 | - * @deprecated 4.0.0 |
|
| 377 | - */ |
|
| 378 | - public ?array $hidden_perm_sections = array(); |
|
| 379 | - |
|
| 380 | - /** |
|
| 381 | - * Deprecated shim for v3 as plugin check. |
|
| 382 | - * |
|
| 383 | - * @var bool |
|
| 384 | - * |
|
| 385 | - * @deprecated 4.0.0 |
|
| 386 | - */ |
|
| 387 | - public static bool $_as_plugin = false; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 388 | - |
|
| 389 | - /** |
|
| 390 | - * Deprecated shim for v3 as plugin check. |
|
| 391 | - * |
|
| 392 | - * @var bool |
|
| 393 | - * |
|
| 394 | - * @deprecated 4.0.0 |
|
| 395 | - */ |
|
| 396 | - public static bool $_is_plugin = false; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 397 | - |
|
| 398 | - /** |
|
| 399 | - * Cloning is forbidden. |
|
| 400 | - * |
|
| 401 | - * @since 4.0.0 |
|
| 402 | - */ |
|
| 403 | - public function __clone() { |
|
| 404 | - _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ eh?', 'redux-framework' ), '4.0' ); |
|
| 405 | - } |
|
| 406 | - |
|
| 407 | - /** |
|
| 408 | - * Un-serializing instances of this class are forbidden. |
|
| 409 | - * |
|
| 410 | - * @since 4.0.0 |
|
| 411 | - */ |
|
| 412 | - public function __wakeup() { |
|
| 413 | - _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ eh?', 'redux-framework' ), '4.0' ); |
|
| 414 | - } |
|
| 415 | - |
|
| 416 | - /** |
|
| 417 | - * Add a deprecating notice for all the old themes that still use this method.. |
|
| 418 | - * |
|
| 419 | - * @param object $filesystem Filesystem object. |
|
| 420 | - * |
|
| 421 | - * @since 4.0.0 |
|
| 422 | - */ |
|
| 423 | - private function deprecated_filesystem( $filesystem ) { |
|
| 424 | - //_deprecated_function( esc_html__( 'The global variable "$filesystem" of the ReduxFramework object', 'redux-framework' ), '4.5.1', 'Redux_Core::$filesystem' ); |
|
| 425 | - |
|
| 426 | - return $filesystem; |
|
| 427 | - } |
|
| 428 | - |
|
| 429 | - /** |
|
| 430 | - * Class Constructor. Defines the args for the theme options class |
|
| 431 | - * |
|
| 432 | - * @param array $sections Panel sections. |
|
| 433 | - * @param array $args Class constructor arguments. |
|
| 434 | - * |
|
| 435 | - * @throws ReflectionException Exception. |
|
| 436 | - * @since 1.0.0 |
|
| 437 | - */ |
|
| 438 | - public function __construct( array $sections = array(), array $args = array() ) { |
|
| 439 | - global $pagenow; |
|
| 440 | - |
|
| 441 | - if ( Redux_Core::is_heartbeat() ) { |
|
| 442 | - return; |
|
| 443 | - } |
|
| 444 | - |
|
| 445 | - $args['load_on_cron'] = $args['load_on_cron'] ?? false; |
|
| 446 | - |
|
| 447 | - if ( false === $args['load_on_cron'] && 'wp-cron.php' === $pagenow ) { |
|
| 448 | - return; |
|
| 449 | - } |
|
| 450 | - |
|
| 451 | - if ( empty( $args ) || ( empty( $args['opt_name'] ) ) ) { |
|
| 452 | - return; |
|
| 453 | - } |
|
| 454 | - |
|
| 455 | - if ( ! isset( Redux::$init[ $args['opt_name'] ] ) ) { |
|
| 456 | - // Let's go back to the Redux API instead of having it run directly. |
|
| 457 | - Redux_Functions_Ex::record_caller( $args['opt_name'] ); |
|
| 458 | - Redux::set_args( $args['opt_name'], $args ); |
|
| 459 | - if ( ! empty( $sections ) ) { |
|
| 460 | - Redux::set_sections( $args['opt_name'], $sections ); |
|
| 461 | - } |
|
| 462 | - $sections = Redux::construct_sections( $args['opt_name'] ); |
|
| 463 | - $args = Redux::construct_args( $args['opt_name'] ); |
|
| 464 | - Redux::set_defaults( $args['opt_name'] ); |
|
| 465 | - Redux::$init[ $args['opt_name'] ] = 1; |
|
| 466 | - } |
|
| 467 | - |
|
| 468 | - $args = new Redux_Args( $this, $args ); |
|
| 469 | - $this->args_class = $args; |
|
| 470 | - $this->args = $args->get; |
|
| 471 | - |
|
| 472 | - Redux_Core::core_construct( $this ); |
|
| 473 | - |
|
| 474 | - new Redux_Admin_Notices( $this ); |
|
| 475 | - |
|
| 476 | - if ( ! empty( $this->args['opt_name'] ) ) { |
|
| 477 | - new Redux_Instances( $this ); |
|
| 478 | - |
|
| 479 | - Redux_Core::$filesystem = Redux_Filesystem::get_instance( $this ); |
|
| 480 | - |
|
| 481 | - $this->filesystem = $this->deprecated_filesystem( Redux_Core::$filesystem ); |
|
| 482 | - |
|
| 483 | - /** |
|
| 484 | - * Filter 'redux/options/{opt_name}/sections' |
|
| 485 | - * |
|
| 486 | - * @param array $sections field option sections |
|
| 487 | - */ |
|
| 488 | - |
|
| 489 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 490 | - $this->sections = apply_filters( "redux/options/{$this->args['opt_name']}/sections", $sections ); |
|
| 491 | - |
|
| 492 | - /** |
|
| 493 | - * Construct hook |
|
| 494 | - * action 'redux/construct' |
|
| 495 | - * |
|
| 496 | - * @param object $this ReduxFramework |
|
| 497 | - */ |
|
| 498 | - |
|
| 499 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 500 | - do_action( 'redux/construct', $this ); |
|
| 501 | - |
|
| 502 | - // Internationalization. |
|
| 503 | - new Redux_I18n( $this, __FILE__ ); |
|
| 504 | - |
|
| 505 | - $this->required_class = new Redux_Required( $this ); |
|
| 506 | - $this->transient_class = new Redux_Transients( $this ); |
|
| 507 | - $this->wordpress_data = new Redux_WordPress_Data( $this ); |
|
| 508 | - $this->validate_class = new Redux_Validation( $this ); |
|
| 509 | - $this->sanitize_class = new Redux_Sanitize( $this ); |
|
| 510 | - |
|
| 511 | - // Register extra extensions. |
|
| 512 | - new Redux_Extensions( $this ); |
|
| 513 | - |
|
| 514 | - // Grab database values. |
|
| 515 | - $this->options_defaults_class = new Redux_Options_Defaults(); |
|
| 516 | - $this->options_class = new Redux_Options_Constructor( $this ); |
|
| 517 | - $this->options_class->get(); |
|
| 518 | - |
|
| 519 | - $this->output_class = new Redux_Output( $this ); |
|
| 520 | - $this->render_class = new Redux_Page_Render( $this ); |
|
| 521 | - $this->enqueue_class = new Redux_Enqueue( $this ); |
|
| 522 | - |
|
| 523 | - new Redux_AJAX_Save( $this ); |
|
| 524 | - new Redux_AJAX_Typography( $this ); |
|
| 525 | - new Redux_AJAX_Select2( $this ); |
|
| 526 | - } |
|
| 527 | - |
|
| 528 | - /** |
|
| 529 | - * Loaded hook |
|
| 530 | - * action 'redux/loaded' |
|
| 531 | - * |
|
| 532 | - * @param object $this ReduxFramework |
|
| 533 | - */ |
|
| 534 | - |
|
| 535 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 536 | - do_action( 'redux/loaded', $this ); |
|
| 537 | - } |
|
| 538 | - |
|
| 539 | - /** |
|
| 540 | - * Begin backward compatibility shims for Redux v3 configs and extensions. |
|
| 541 | - */ |
|
| 542 | - |
|
| 543 | - /** |
|
| 544 | - * SHIM: _register_settings |
|
| 545 | - * |
|
| 546 | - * @deprecated 4.0.0 |
|
| 547 | - */ |
|
| 548 | - public function _register_settings() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 549 | - _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->register()' ); |
|
| 550 | - |
|
| 551 | - $this->options_class->register(); |
|
| 552 | - } |
|
| 553 | - |
|
| 554 | - /** |
|
| 555 | - * SHIM: _field_input |
|
| 556 | - * |
|
| 557 | - * @param array $field Field array. |
|
| 558 | - * @param string|array $v Field values. |
|
| 559 | - * |
|
| 560 | - * @deprecated 4.0.0 |
|
| 561 | - */ |
|
| 562 | - public function _field_input( array $field, $v = null ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 563 | - _deprecated_function( __FUNCTION__, '4.0.0', 'render_class->field_input( $field, $value )' ); |
|
| 564 | - |
|
| 565 | - $this->render_class->field_input( $field, $v ); |
|
| 566 | - } |
|
| 567 | - |
|
| 568 | - /** |
|
| 569 | - * SHIM: field_default_values |
|
| 570 | - * |
|
| 571 | - * @param array $field Field array. |
|
| 572 | - * |
|
| 573 | - * @deprecated 4.0.0 |
|
| 574 | - */ |
|
| 575 | - public function field_default_values( array $field ) { |
|
| 576 | - _deprecated_function( __FUNCTION__, '4.0.0', 'options_defaults_class->field_default_values( $opt_name, $field )' ); |
|
| 577 | - |
|
| 578 | - $this->options_defaults_class->field_default_values( '', $field ); |
|
| 579 | - } |
|
| 580 | - |
|
| 581 | - /** |
|
| 582 | - * SHIM: set_options |
|
| 583 | - * |
|
| 584 | - * @param string|array $value Option values. |
|
| 585 | - * |
|
| 586 | - * @deprecated 4.0.0 |
|
| 587 | - */ |
|
| 588 | - public function set_options( $value ) { |
|
| 589 | - _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->set( $value )' ); |
|
| 590 | - |
|
| 591 | - $this->options_class->set( $value ); |
|
| 592 | - } |
|
| 593 | - |
|
| 594 | - /** |
|
| 595 | - * SHIM: get_options |
|
| 596 | - * |
|
| 597 | - * @deprecated 4.0.0 |
|
| 598 | - */ |
|
| 599 | - public function get_options() { |
|
| 600 | - _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->get()' ); |
|
| 601 | - |
|
| 602 | - $this->options_class->get(); |
|
| 603 | - } |
|
| 604 | - |
|
| 605 | - /** |
|
| 606 | - * SHIM: _default_values |
|
| 607 | - * |
|
| 608 | - * @return array |
|
| 609 | - * |
|
| 610 | - * @deprecated 4.0.0 |
|
| 611 | - */ |
|
| 612 | - public function _default_values() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 613 | - _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->default_values()' ); |
|
| 614 | - |
|
| 615 | - return $this->default_values(); |
|
| 616 | - } |
|
| 617 | - |
|
| 618 | - /** |
|
| 619 | - * Get default values. |
|
| 620 | - * |
|
| 621 | - * @return array |
|
| 622 | - */ |
|
| 623 | - public function default_values() { |
|
| 624 | - if ( ! isset( $this->options_class ) ) { |
|
| 625 | - $this->options_defaults_class = new Redux_Options_Defaults(); |
|
| 626 | - $this->options_class = new Redux_Options_Constructor( $this ); |
|
| 627 | - } |
|
| 628 | - |
|
| 629 | - return $this->options_class->default_values(); |
|
| 630 | - } |
|
| 631 | - |
|
| 632 | - /** |
|
| 633 | - * SHIM: check_dependencies |
|
| 634 | - * |
|
| 635 | - * @param array $field Field array. |
|
| 636 | - * |
|
| 637 | - * @deprecated 4.0.0 |
|
| 638 | - */ |
|
| 639 | - public function check_dependencies( array $field ) { |
|
| 640 | - _deprecated_function( __FUNCTION__, '4.0.0', 'required_class->check_dependencies( $field )' ); |
|
| 641 | - |
|
| 642 | - $this->required_class->check_dependencies( $field ); |
|
| 643 | - } |
|
| 644 | - |
|
| 645 | - /** |
|
| 646 | - * SHIM: _enqueue_output |
|
| 647 | - * |
|
| 648 | - * @throws ReflectionException Exception. |
|
| 649 | - * |
|
| 650 | - * @deprecated 4.0.0 |
|
| 651 | - */ |
|
| 652 | - public function _enqueue_output() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 653 | - _deprecated_function( __FUNCTION__, '4.0.0', 'output_class->enqueue()' ); |
|
| 654 | - |
|
| 655 | - if ( empty( $this->output_class ) ) { |
|
| 656 | - $obj = new ReduxFramework( $this->sections, $this->args ); |
|
| 657 | - $obj->options = $this->options; |
|
| 658 | - $obj->output_class->enqueue(); |
|
| 659 | - $this->outputCSS = $obj->outputCSS; // phpcs:ignore WordPress.NamingConventions.ValidVariableName |
|
| 660 | - } else { |
|
| 661 | - $this->output_class->enqueue(); |
|
| 662 | - } |
|
| 663 | - } |
|
| 664 | - |
|
| 665 | - /** |
|
| 666 | - * SHIM: _enqueue |
|
| 667 | - * |
|
| 668 | - * @deprecated 4.0.0 |
|
| 669 | - */ |
|
| 670 | - public function _enqueue() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 671 | - _deprecated_function( __FUNCTION__, '4.0.0', 'enqueue_class->init()' ); |
|
| 672 | - |
|
| 673 | - $this->enqueue_class->init(); |
|
| 674 | - } |
|
| 675 | - |
|
| 676 | - /** |
|
| 677 | - * _enqueue replacement. |
|
| 678 | - * |
|
| 679 | - * @return void |
|
| 680 | - */ |
|
| 681 | - public function init_enqueue() { |
|
| 682 | - $this->enqueue_class->init(); |
|
| 683 | - } |
|
| 684 | - |
|
| 685 | - /** |
|
| 686 | - * SHIM: generate_panel |
|
| 687 | - * |
|
| 688 | - * @since 1.0.0 |
|
| 689 | - * @access public |
|
| 690 | - * @return void |
|
| 691 | - * |
|
| 692 | - * @deprecated 4.0.0 |
|
| 693 | - */ |
|
| 694 | - public function generate_panel() { |
|
| 695 | - _deprecated_function( __FUNCTION__, '4.0.0', 'render_class->generate_panel()' ); |
|
| 696 | - |
|
| 697 | - $this->render_class->generate_panel(); |
|
| 698 | - } |
|
| 699 | - |
|
| 700 | - /** |
|
| 701 | - * SHIM: get_default_values |
|
| 702 | - * |
|
| 703 | - * @param string $key Key value. |
|
| 704 | - * @param bool $array_key Flag to determine array status. |
|
| 705 | - * |
|
| 706 | - * @return array |
|
| 707 | - * |
|
| 708 | - * @deprecated 4.0.0 |
|
| 709 | - */ |
|
| 710 | - public function get_default_values( $key, $array_key = false ) { |
|
| 711 | - _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->get_default_value( $key, $array_key )' ); |
|
| 712 | - |
|
| 713 | - if ( ! isset( $this->options_class ) ) { |
|
| 714 | - $this->options_defaults_class = new Redux_Options_Defaults(); |
|
| 715 | - $this->options_class = new Redux_Options_Constructor( $this ); |
|
| 716 | - } |
|
| 717 | - |
|
| 718 | - return $this->options_class->get_default_value( $key, $array_key ); |
|
| 719 | - } |
|
| 720 | - |
|
| 721 | - /** |
|
| 722 | - * SHIM: get_default_value |
|
| 723 | - * |
|
| 724 | - * @param string $key Key value. |
|
| 725 | - * @param bool $array_key Flag to determine array status. |
|
| 726 | - * |
|
| 727 | - * @return array |
|
| 728 | - * |
|
| 729 | - * @deprecated 4.0.0 |
|
| 730 | - */ |
|
| 731 | - public function get_default_value( $key, $array_key = false ) { |
|
| 732 | - _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->get_default_value( $key, $array_key )' ); |
|
| 733 | - |
|
| 734 | - if ( ! isset( $this->options_class ) ) { |
|
| 735 | - $this->options_defaults_class = new Redux_Options_Defaults(); |
|
| 736 | - $this->options_class = new Redux_Options_Constructor( $this ); |
|
| 737 | - } |
|
| 738 | - |
|
| 739 | - return $this->options_class->get_default_value( $key, $array_key ); |
|
| 740 | - } |
|
| 741 | - |
|
| 742 | - /** |
|
| 743 | - * SHIM: get_wordpress_data |
|
| 744 | - * |
|
| 745 | - * @param bool $type data type. |
|
| 746 | - * @param array $args args to pass to WordPress API. |
|
| 747 | - * @param string|array $current_value Current value. |
|
| 748 | - * |
|
| 749 | - * @return array|mixed|string|void |
|
| 750 | - * |
|
| 751 | - * @deprecated 4.0.0 |
|
| 752 | - */ |
|
| 753 | - public function get_wordpress_data( $type = false, $args = array(), $current_value = null ) { |
|
| 754 | - _deprecated_function( __FUNCTION__, '4.0.0', 'wordpress_data->get( $type, $args, $opt_name, $value )' ); |
|
| 755 | - |
|
| 756 | - return $this->wordpress_data->get( $type, $args, $this->args['opt_name'], $current_value ); |
|
| 757 | - } |
|
| 758 | - |
|
| 759 | - /** |
|
| 760 | - * SHIM: _validate_values |
|
| 761 | - * |
|
| 762 | - * @param array $plugin_options Current panel options. |
|
| 763 | - * @param array $options Options to validate. |
|
| 764 | - * @param array $sections Sections array. |
|
| 765 | - * |
|
| 766 | - * @return array |
|
| 767 | - * |
|
| 768 | - * @deprecated 4.0.0 |
|
| 769 | - */ |
|
| 770 | - public function _validate_values( $plugin_options, $options, $sections ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 771 | - _deprecated_function( __FUNCTION__, '4.0.0', 'validate_class->validate( $plugin_options, $options, $sections )' ); |
|
| 772 | - |
|
| 773 | - if ( ! isset( $this->validate_class ) ) { |
|
| 774 | - $this->validate_class = new Redux_Validation( $this ); |
|
| 775 | - } |
|
| 776 | - |
|
| 777 | - return $this->validate_class->validate( $plugin_options, $options, $sections ); |
|
| 778 | - } |
|
| 779 | - |
|
| 780 | - /** |
|
| 781 | - * SHIM: set_transients |
|
| 782 | - * |
|
| 783 | - * @return void |
|
| 784 | - * |
|
| 785 | - * @deprecated 4.0.0 |
|
| 786 | - */ |
|
| 787 | - public function set_transients() { |
|
| 788 | - _deprecated_function( __FUNCTION__, '4.0.0', 'Please update the extension that uses this deprecated function.' ); |
|
| 789 | - } |
|
| 790 | - |
|
| 791 | - /** |
|
| 792 | - * SHIM: section_menu |
|
| 793 | - * |
|
| 794 | - * @param int $k Array Key. |
|
| 795 | - * @param array $section Section array. |
|
| 796 | - * @param string $suffix Unique string. |
|
| 797 | - * @param array $sections Section array. |
|
| 798 | - * |
|
| 799 | - * @return string |
|
| 800 | - * |
|
| 801 | - * @deprecated 4.0.0 |
|
| 802 | - */ |
|
| 803 | - public function section_menu( $k, $section, $suffix = '', $sections = array() ) { |
|
| 804 | - _deprecated_function( __FUNCTION__, '4.0.0', 'render_class->section_menu( $index, $section, $suffix, $sections )' ); |
|
| 805 | - |
|
| 806 | - return $this->render_class->section_menu( $k, $section, $suffix, $sections ); |
|
| 807 | - } |
|
| 808 | - |
|
| 809 | - /** |
|
| 810 | - * SHIM: get_header_html |
|
| 811 | - * |
|
| 812 | - * @param array $field Field array. |
|
| 813 | - * |
|
| 814 | - * @return string |
|
| 815 | - * |
|
| 816 | - * @deprecated 4.0.0 |
|
| 817 | - */ |
|
| 818 | - public function get_header_html( $field ) { |
|
| 819 | - _deprecated_function( __FUNCTION__, '4.0.0', 'render_class->get_header_html( $field )' ); |
|
| 820 | - |
|
| 821 | - return $this->render_class->get_header_html( $field ); |
|
| 822 | - } |
|
| 823 | - |
|
| 824 | - /** |
|
| 825 | - * SHIM: current_user_can |
|
| 826 | - * |
|
| 827 | - * @param string $permission User permission. |
|
| 828 | - * |
|
| 829 | - * @return bool |
|
| 830 | - * |
|
| 831 | - * @deprecated 4.0.0 |
|
| 832 | - */ |
|
| 833 | - public function current_user_can( $permission ) { |
|
| 834 | - _deprecated_function( __FUNCTION__, '4.0.0', 'Redux_Helpers::current_user_can' ); |
|
| 835 | - |
|
| 836 | - return Redux_Helpers::current_user_can( $permission ); |
|
| 837 | - } |
|
| 838 | - |
|
| 839 | - /** |
|
| 840 | - * End backward compatibility shims for Redux v3 configs and extensions. |
|
| 841 | - */ |
|
| 842 | - |
|
| 843 | - /** |
|
| 844 | - * Pointer to the ReduxFramework instance. |
|
| 845 | - * |
|
| 846 | - * @return ReduxFramework|null |
|
| 847 | - */ |
|
| 848 | - public function get_instance(): ?ReduxFramework { |
|
| 849 | - return self::$instance; |
|
| 850 | - } |
|
| 851 | - |
|
| 852 | - /** |
|
| 853 | - * →get(); This is used to return and option value from the option array |
|
| 854 | - * |
|
| 855 | - * @since 1.0.0 |
|
| 856 | - * @access public |
|
| 857 | - * |
|
| 858 | - * @param string $opt_name The option name to return. |
|
| 859 | - * @param mixed $defaults (null) The value to return if an option isn't set. |
|
| 860 | - * |
|
| 861 | - * @return mixed |
|
| 862 | - */ |
|
| 863 | - public function get( string $opt_name, $defaults = null ) { |
|
| 864 | - return ( ! empty( $this->options[ $opt_name ] ) ) ? $this->options[ $opt_name ] : $this->options_class->get_default( $opt_name, $defaults ); |
|
| 865 | - } |
|
| 866 | - |
|
| 867 | - /** |
|
| 868 | - * →set(); This is used to set an arbitrary option in the option array |
|
| 869 | - * |
|
| 870 | - * @since 1.0.0 |
|
| 871 | - * @access public |
|
| 872 | - * |
|
| 873 | - * @param string $opt_name The name of the option being added. |
|
| 874 | - * @param mixed $values The value of the option being added. |
|
| 875 | - * |
|
| 876 | - * @return void |
|
| 877 | - */ |
|
| 878 | - public function set( string $opt_name = '', $values = array() ) { |
|
| 879 | - if ( ! empty( $opt_name ) && is_array( $values ) ) { |
|
| 880 | - $this->options[ $opt_name ] = $values; |
|
| 881 | - $this->options_class->set( $values ); |
|
| 882 | - } |
|
| 883 | - } |
|
| 884 | - } |
|
| 885 | - |
|
| 886 | - ReduxFramework::init(); |
|
| 887 | - |
|
| 888 | - /** |
|
| 889 | - * Action 'redux/init' |
|
| 890 | - */ |
|
| 891 | - do_action( 'redux/init' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 42 | + /** |
|
| 43 | + * Main ReduxFramework class |
|
| 44 | + * |
|
| 45 | + * @since 1.0.0 |
|
| 46 | + */ |
|
| 47 | + class ReduxFramework { |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * ReduxFramework instance storage. |
|
| 51 | + * |
|
| 52 | + * @var null|ReduxFramework |
|
| 53 | + * @access public |
|
| 54 | + */ |
|
| 55 | + public static ?ReduxFramework $instance; |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * Redux current version. |
|
| 59 | + * |
|
| 60 | + * @var string |
|
| 61 | + * @access public |
|
| 62 | + * |
|
| 63 | + * @deprecated 4.0.0 |
|
| 64 | + */ |
|
| 65 | + public static string $_version = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * Absolute directory of the Redux instance. |
|
| 69 | + * |
|
| 70 | + * @var string |
|
| 71 | + * @access public |
|
| 72 | + * |
|
| 73 | + * @deprecated 4.0.0 |
|
| 74 | + */ |
|
| 75 | + public static string $_dir = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * Full URL of the Redux instance. |
|
| 79 | + * |
|
| 80 | + * @var string |
|
| 81 | + * @access public |
|
| 82 | + * |
|
| 83 | + * @deprecated 4.0.0 |
|
| 84 | + */ |
|
| 85 | + public static string $_url = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * Current WordPress upload directory. |
|
| 89 | + * |
|
| 90 | + * @var string |
|
| 91 | + * @access public |
|
| 92 | + * |
|
| 93 | + * @deprecated 4.0.0 |
|
| 94 | + */ |
|
| 95 | + public static string $_upload_dir = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 96 | + |
|
| 97 | + /** |
|
| 98 | + * Current WordPress upload URL |
|
| 99 | + * |
|
| 100 | + * @var string |
|
| 101 | + * @access public |
|
| 102 | + * |
|
| 103 | + * @deprecated 4.0.0 |
|
| 104 | + */ |
|
| 105 | + public static string $_upload_url; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Init |
|
| 109 | + * |
|
| 110 | + * Backward compatibility for previous versions of Redux. |
|
| 111 | + */ |
|
| 112 | + public static function init() { |
|
| 113 | + |
|
| 114 | + // Backward compatibility for extensions. |
|
| 115 | + self::$_version = Redux_Core::$version; |
|
| 116 | + self::$_dir = Redux_Core::$dir; |
|
| 117 | + self::$_url = Redux_Core::$url; |
|
| 118 | + self::$_upload_dir = Redux_Core::$upload_dir; |
|
| 119 | + self::$_upload_url = Redux_Core::$upload_url; |
|
| 120 | + self::$_as_plugin = Redux_Core::$as_plugin; |
|
| 121 | + self::$_is_plugin = Redux_Core::$is_plugin; |
|
| 122 | + } |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * Array of field arrays. |
|
| 126 | + * |
|
| 127 | + * @var null|array |
|
| 128 | + */ |
|
| 129 | + public ?array $fields = array(); |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * Array of field sections. |
|
| 133 | + * |
|
| 134 | + * @var null|array |
|
| 135 | + */ |
|
| 136 | + public ?array $field_sections = array(); |
|
| 137 | + |
|
| 138 | + /** |
|
| 139 | + * Array of field types. |
|
| 140 | + * |
|
| 141 | + * @var null|array |
|
| 142 | + */ |
|
| 143 | + public ?array $field_types = array(); |
|
| 144 | + |
|
| 145 | + /** |
|
| 146 | + * Array of field heads. |
|
| 147 | + * |
|
| 148 | + * @var null|array |
|
| 149 | + */ |
|
| 150 | + public ?array $field_head = array(); |
|
| 151 | + |
|
| 152 | + /** |
|
| 153 | + * Array of extensions by type used in the panel. |
|
| 154 | + * |
|
| 155 | + * @var null|array |
|
| 156 | + */ |
|
| 157 | + public ?array $extensions = array(); |
|
| 158 | + |
|
| 159 | + /** |
|
| 160 | + * Array of sections and fields arrays. |
|
| 161 | + * |
|
| 162 | + * @var null|array |
|
| 163 | + */ |
|
| 164 | + public ?array $sections = array(); |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * Array of generated errors from the panel for localization. |
|
| 168 | + * |
|
| 169 | + * @var null|array |
|
| 170 | + */ |
|
| 171 | + public ?array $errors = array(); |
|
| 172 | + |
|
| 173 | + /** |
|
| 174 | + * Array of generated warnings from the panel for localization. |
|
| 175 | + * |
|
| 176 | + * @var null|array |
|
| 177 | + */ |
|
| 178 | + public ?array $warnings = array(); |
|
| 179 | + |
|
| 180 | + /** |
|
| 181 | + * Array of generated sanitize notices from the panel for localization. |
|
| 182 | + * |
|
| 183 | + * @var null|array |
|
| 184 | + */ |
|
| 185 | + public ?array $sanitize = array(); |
|
| 186 | + |
|
| 187 | + /** |
|
| 188 | + * Array of current option values. |
|
| 189 | + * |
|
| 190 | + * @var null|array |
|
| 191 | + */ |
|
| 192 | + public ?array $options = array(); |
|
| 193 | + |
|
| 194 | + /** |
|
| 195 | + * Array of option defaults. |
|
| 196 | + * |
|
| 197 | + * @var null|array |
|
| 198 | + */ |
|
| 199 | + public ?array $options_defaults = null; |
|
| 200 | + |
|
| 201 | + /** |
|
| 202 | + * Array of fields set to trigger the compiler hook. |
|
| 203 | + * |
|
| 204 | + * @var null|array |
|
| 205 | + */ |
|
| 206 | + public ?array $compiler_fields = array(); |
|
| 207 | + |
|
| 208 | + /** |
|
| 209 | + * Array of fields with CSS output selectors. |
|
| 210 | + * |
|
| 211 | + * @var null|array |
|
| 212 | + */ |
|
| 213 | + public ?array $output = array(); |
|
| 214 | + |
|
| 215 | + /** |
|
| 216 | + * Autogenerated CSS appended to the header (snake case maintained for backward compatibility). |
|
| 217 | + * |
|
| 218 | + * @var null|string |
|
| 219 | + */ |
|
| 220 | + public ?string $outputCSS = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName |
|
| 221 | + |
|
| 222 | + /** |
|
| 223 | + * Autogenerated variables appended to dynamic output. |
|
| 224 | + * |
|
| 225 | + * @var null|array |
|
| 226 | + */ |
|
| 227 | + public ?array $output_variables = array(); |
|
| 228 | + |
|
| 229 | + /** |
|
| 230 | + * CSS sent to the compiler hook (snake case maintained for backward compatibility). |
|
| 231 | + * |
|
| 232 | + * @var null|string |
|
| 233 | + */ |
|
| 234 | + public ?string $compilerCSS = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName |
|
| 235 | + |
|
| 236 | + /** |
|
| 237 | + * Array of global arguments. |
|
| 238 | + * |
|
| 239 | + * @var array|null |
|
| 240 | + */ |
|
| 241 | + public ?array $args = array(); |
|
| 242 | + |
|
| 243 | + /** |
|
| 244 | + * Used in customizer hooks. |
|
| 245 | + * |
|
| 246 | + * @var null|string |
|
| 247 | + */ |
|
| 248 | + public ?string $old_opt_name = ''; |
|
| 249 | + |
|
| 250 | + /** |
|
| 251 | + * Pointer to the Redux_Options_Default class. |
|
| 252 | + * |
|
| 253 | + * @var null|Redux_Options_Defaults |
|
| 254 | + */ |
|
| 255 | + public ?Redux_Options_Defaults $options_defaults_class = null; |
|
| 256 | + |
|
| 257 | + /** |
|
| 258 | + * Pointer to the Redux_Options class. |
|
| 259 | + * |
|
| 260 | + * @var null|Redux_Options_Constructor |
|
| 261 | + */ |
|
| 262 | + public ?Redux_Options_Constructor $options_class = null; |
|
| 263 | + |
|
| 264 | + /** |
|
| 265 | + * Pointer to the Redux_Required class |
|
| 266 | + * |
|
| 267 | + * @var null|Redux_Required |
|
| 268 | + */ |
|
| 269 | + public ?Redux_Required $required_class = null; |
|
| 270 | + |
|
| 271 | + /** |
|
| 272 | + * Pointer to the Redux_Output class. |
|
| 273 | + * |
|
| 274 | + * @var null|Redux_Output |
|
| 275 | + */ |
|
| 276 | + public ?Redux_Output $output_class = null; |
|
| 277 | + |
|
| 278 | + /** |
|
| 279 | + * Pointer to the Redux_Page_Render class. |
|
| 280 | + * |
|
| 281 | + * @var null|Redux_Page_Render |
|
| 282 | + */ |
|
| 283 | + public ?Redux_Page_Render $render_class = null; |
|
| 284 | + |
|
| 285 | + /** |
|
| 286 | + * Pointer to the Redux_Enqueue class. |
|
| 287 | + * |
|
| 288 | + * @var null|Redux_Enqueue |
|
| 289 | + */ |
|
| 290 | + public ?Redux_Enqueue $enqueue_class = null; |
|
| 291 | + |
|
| 292 | + /** |
|
| 293 | + * Pointer to the Redux_Transients class. |
|
| 294 | + * |
|
| 295 | + * @var null|Redux_Transients |
|
| 296 | + */ |
|
| 297 | + public ?Redux_Transients $transient_class = null; |
|
| 298 | + |
|
| 299 | + /** |
|
| 300 | + * Pointer to the Redux_wordPress_Data class. |
|
| 301 | + * |
|
| 302 | + * @var null|Redux_WordPress_Data |
|
| 303 | + */ |
|
| 304 | + public ?Redux_WordPress_Data $wordpress_data = null; |
|
| 305 | + |
|
| 306 | + /** |
|
| 307 | + * Pointer to the Redux_Validation class. |
|
| 308 | + * |
|
| 309 | + * @var null|Redux_Validation |
|
| 310 | + */ |
|
| 311 | + public ?Redux_Validation $validate_class = null; |
|
| 312 | + |
|
| 313 | + /** |
|
| 314 | + * Pointer to the Redux_Sanitize class. |
|
| 315 | + * |
|
| 316 | + * @var null|Redux_Sanitize |
|
| 317 | + */ |
|
| 318 | + public ?Redux_Sanitize $sanitize_class = null; |
|
| 319 | + |
|
| 320 | + /** |
|
| 321 | + * Pointer to the Redux_Args class. |
|
| 322 | + * |
|
| 323 | + * @var null|Redux_Args |
|
| 324 | + */ |
|
| 325 | + public ?Redux_Args $args_class = null; |
|
| 326 | + |
|
| 327 | + /** |
|
| 328 | + * Array of active transients used by Redux. |
|
| 329 | + * |
|
| 330 | + * @var null|mixed |
|
| 331 | + */ |
|
| 332 | + public $transients = array(); |
|
| 333 | + |
|
| 334 | + /** |
|
| 335 | + * Array of localized repeater data. |
|
| 336 | + * |
|
| 337 | + * @var null|array |
|
| 338 | + */ |
|
| 339 | + public ?array $repeater_data = array(); |
|
| 340 | + |
|
| 341 | + /** |
|
| 342 | + * Array of localized data. |
|
| 343 | + * |
|
| 344 | + * @var null|array |
|
| 345 | + */ |
|
| 346 | + public ?array $localize_data = array(); |
|
| 347 | + |
|
| 348 | + /** |
|
| 349 | + * Array of checked transients used by Redux. |
|
| 350 | + * |
|
| 351 | + * @var null|mixed |
|
| 352 | + */ |
|
| 353 | + public $transients_check = array(); |
|
| 354 | + |
|
| 355 | + /** |
|
| 356 | + * Never save to DB flag for metaboxes. |
|
| 357 | + * |
|
| 358 | + * @var bool |
|
| 359 | + */ |
|
| 360 | + public bool $never_save_to_db; |
|
| 361 | + |
|
| 362 | + /** |
|
| 363 | + * File system object used for I/O file operations. Done the WordPress way. |
|
| 364 | + * |
|
| 365 | + * @var null|object |
|
| 366 | + * |
|
| 367 | + * @deprecated 4.5.1 |
|
| 368 | + */ |
|
| 369 | + public ?object $filesystem; |
|
| 370 | + |
|
| 371 | + /** |
|
| 372 | + * Deprecated shim for v3 templates. |
|
| 373 | + * |
|
| 374 | + * @var null|array |
|
| 375 | + * |
|
| 376 | + * @deprecated 4.0.0 |
|
| 377 | + */ |
|
| 378 | + public ?array $hidden_perm_sections = array(); |
|
| 379 | + |
|
| 380 | + /** |
|
| 381 | + * Deprecated shim for v3 as plugin check. |
|
| 382 | + * |
|
| 383 | + * @var bool |
|
| 384 | + * |
|
| 385 | + * @deprecated 4.0.0 |
|
| 386 | + */ |
|
| 387 | + public static bool $_as_plugin = false; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 388 | + |
|
| 389 | + /** |
|
| 390 | + * Deprecated shim for v3 as plugin check. |
|
| 391 | + * |
|
| 392 | + * @var bool |
|
| 393 | + * |
|
| 394 | + * @deprecated 4.0.0 |
|
| 395 | + */ |
|
| 396 | + public static bool $_is_plugin = false; // phpcs:ignore PSR2.Classes.PropertyDeclaration |
|
| 397 | + |
|
| 398 | + /** |
|
| 399 | + * Cloning is forbidden. |
|
| 400 | + * |
|
| 401 | + * @since 4.0.0 |
|
| 402 | + */ |
|
| 403 | + public function __clone() { |
|
| 404 | + _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ eh?', 'redux-framework' ), '4.0' ); |
|
| 405 | + } |
|
| 406 | + |
|
| 407 | + /** |
|
| 408 | + * Un-serializing instances of this class are forbidden. |
|
| 409 | + * |
|
| 410 | + * @since 4.0.0 |
|
| 411 | + */ |
|
| 412 | + public function __wakeup() { |
|
| 413 | + _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ eh?', 'redux-framework' ), '4.0' ); |
|
| 414 | + } |
|
| 415 | + |
|
| 416 | + /** |
|
| 417 | + * Add a deprecating notice for all the old themes that still use this method.. |
|
| 418 | + * |
|
| 419 | + * @param object $filesystem Filesystem object. |
|
| 420 | + * |
|
| 421 | + * @since 4.0.0 |
|
| 422 | + */ |
|
| 423 | + private function deprecated_filesystem( $filesystem ) { |
|
| 424 | + //_deprecated_function( esc_html__( 'The global variable "$filesystem" of the ReduxFramework object', 'redux-framework' ), '4.5.1', 'Redux_Core::$filesystem' ); |
|
| 425 | + |
|
| 426 | + return $filesystem; |
|
| 427 | + } |
|
| 428 | + |
|
| 429 | + /** |
|
| 430 | + * Class Constructor. Defines the args for the theme options class |
|
| 431 | + * |
|
| 432 | + * @param array $sections Panel sections. |
|
| 433 | + * @param array $args Class constructor arguments. |
|
| 434 | + * |
|
| 435 | + * @throws ReflectionException Exception. |
|
| 436 | + * @since 1.0.0 |
|
| 437 | + */ |
|
| 438 | + public function __construct( array $sections = array(), array $args = array() ) { |
|
| 439 | + global $pagenow; |
|
| 440 | + |
|
| 441 | + if ( Redux_Core::is_heartbeat() ) { |
|
| 442 | + return; |
|
| 443 | + } |
|
| 444 | + |
|
| 445 | + $args['load_on_cron'] = $args['load_on_cron'] ?? false; |
|
| 446 | + |
|
| 447 | + if ( false === $args['load_on_cron'] && 'wp-cron.php' === $pagenow ) { |
|
| 448 | + return; |
|
| 449 | + } |
|
| 450 | + |
|
| 451 | + if ( empty( $args ) || ( empty( $args['opt_name'] ) ) ) { |
|
| 452 | + return; |
|
| 453 | + } |
|
| 454 | + |
|
| 455 | + if ( ! isset( Redux::$init[ $args['opt_name'] ] ) ) { |
|
| 456 | + // Let's go back to the Redux API instead of having it run directly. |
|
| 457 | + Redux_Functions_Ex::record_caller( $args['opt_name'] ); |
|
| 458 | + Redux::set_args( $args['opt_name'], $args ); |
|
| 459 | + if ( ! empty( $sections ) ) { |
|
| 460 | + Redux::set_sections( $args['opt_name'], $sections ); |
|
| 461 | + } |
|
| 462 | + $sections = Redux::construct_sections( $args['opt_name'] ); |
|
| 463 | + $args = Redux::construct_args( $args['opt_name'] ); |
|
| 464 | + Redux::set_defaults( $args['opt_name'] ); |
|
| 465 | + Redux::$init[ $args['opt_name'] ] = 1; |
|
| 466 | + } |
|
| 467 | + |
|
| 468 | + $args = new Redux_Args( $this, $args ); |
|
| 469 | + $this->args_class = $args; |
|
| 470 | + $this->args = $args->get; |
|
| 471 | + |
|
| 472 | + Redux_Core::core_construct( $this ); |
|
| 473 | + |
|
| 474 | + new Redux_Admin_Notices( $this ); |
|
| 475 | + |
|
| 476 | + if ( ! empty( $this->args['opt_name'] ) ) { |
|
| 477 | + new Redux_Instances( $this ); |
|
| 478 | + |
|
| 479 | + Redux_Core::$filesystem = Redux_Filesystem::get_instance( $this ); |
|
| 480 | + |
|
| 481 | + $this->filesystem = $this->deprecated_filesystem( Redux_Core::$filesystem ); |
|
| 482 | + |
|
| 483 | + /** |
|
| 484 | + * Filter 'redux/options/{opt_name}/sections' |
|
| 485 | + * |
|
| 486 | + * @param array $sections field option sections |
|
| 487 | + */ |
|
| 488 | + |
|
| 489 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 490 | + $this->sections = apply_filters( "redux/options/{$this->args['opt_name']}/sections", $sections ); |
|
| 491 | + |
|
| 492 | + /** |
|
| 493 | + * Construct hook |
|
| 494 | + * action 'redux/construct' |
|
| 495 | + * |
|
| 496 | + * @param object $this ReduxFramework |
|
| 497 | + */ |
|
| 498 | + |
|
| 499 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 500 | + do_action( 'redux/construct', $this ); |
|
| 501 | + |
|
| 502 | + // Internationalization. |
|
| 503 | + new Redux_I18n( $this, __FILE__ ); |
|
| 504 | + |
|
| 505 | + $this->required_class = new Redux_Required( $this ); |
|
| 506 | + $this->transient_class = new Redux_Transients( $this ); |
|
| 507 | + $this->wordpress_data = new Redux_WordPress_Data( $this ); |
|
| 508 | + $this->validate_class = new Redux_Validation( $this ); |
|
| 509 | + $this->sanitize_class = new Redux_Sanitize( $this ); |
|
| 510 | + |
|
| 511 | + // Register extra extensions. |
|
| 512 | + new Redux_Extensions( $this ); |
|
| 513 | + |
|
| 514 | + // Grab database values. |
|
| 515 | + $this->options_defaults_class = new Redux_Options_Defaults(); |
|
| 516 | + $this->options_class = new Redux_Options_Constructor( $this ); |
|
| 517 | + $this->options_class->get(); |
|
| 518 | + |
|
| 519 | + $this->output_class = new Redux_Output( $this ); |
|
| 520 | + $this->render_class = new Redux_Page_Render( $this ); |
|
| 521 | + $this->enqueue_class = new Redux_Enqueue( $this ); |
|
| 522 | + |
|
| 523 | + new Redux_AJAX_Save( $this ); |
|
| 524 | + new Redux_AJAX_Typography( $this ); |
|
| 525 | + new Redux_AJAX_Select2( $this ); |
|
| 526 | + } |
|
| 527 | + |
|
| 528 | + /** |
|
| 529 | + * Loaded hook |
|
| 530 | + * action 'redux/loaded' |
|
| 531 | + * |
|
| 532 | + * @param object $this ReduxFramework |
|
| 533 | + */ |
|
| 534 | + |
|
| 535 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 536 | + do_action( 'redux/loaded', $this ); |
|
| 537 | + } |
|
| 538 | + |
|
| 539 | + /** |
|
| 540 | + * Begin backward compatibility shims for Redux v3 configs and extensions. |
|
| 541 | + */ |
|
| 542 | + |
|
| 543 | + /** |
|
| 544 | + * SHIM: _register_settings |
|
| 545 | + * |
|
| 546 | + * @deprecated 4.0.0 |
|
| 547 | + */ |
|
| 548 | + public function _register_settings() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 549 | + _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->register()' ); |
|
| 550 | + |
|
| 551 | + $this->options_class->register(); |
|
| 552 | + } |
|
| 553 | + |
|
| 554 | + /** |
|
| 555 | + * SHIM: _field_input |
|
| 556 | + * |
|
| 557 | + * @param array $field Field array. |
|
| 558 | + * @param string|array $v Field values. |
|
| 559 | + * |
|
| 560 | + * @deprecated 4.0.0 |
|
| 561 | + */ |
|
| 562 | + public function _field_input( array $field, $v = null ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 563 | + _deprecated_function( __FUNCTION__, '4.0.0', 'render_class->field_input( $field, $value )' ); |
|
| 564 | + |
|
| 565 | + $this->render_class->field_input( $field, $v ); |
|
| 566 | + } |
|
| 567 | + |
|
| 568 | + /** |
|
| 569 | + * SHIM: field_default_values |
|
| 570 | + * |
|
| 571 | + * @param array $field Field array. |
|
| 572 | + * |
|
| 573 | + * @deprecated 4.0.0 |
|
| 574 | + */ |
|
| 575 | + public function field_default_values( array $field ) { |
|
| 576 | + _deprecated_function( __FUNCTION__, '4.0.0', 'options_defaults_class->field_default_values( $opt_name, $field )' ); |
|
| 577 | + |
|
| 578 | + $this->options_defaults_class->field_default_values( '', $field ); |
|
| 579 | + } |
|
| 580 | + |
|
| 581 | + /** |
|
| 582 | + * SHIM: set_options |
|
| 583 | + * |
|
| 584 | + * @param string|array $value Option values. |
|
| 585 | + * |
|
| 586 | + * @deprecated 4.0.0 |
|
| 587 | + */ |
|
| 588 | + public function set_options( $value ) { |
|
| 589 | + _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->set( $value )' ); |
|
| 590 | + |
|
| 591 | + $this->options_class->set( $value ); |
|
| 592 | + } |
|
| 593 | + |
|
| 594 | + /** |
|
| 595 | + * SHIM: get_options |
|
| 596 | + * |
|
| 597 | + * @deprecated 4.0.0 |
|
| 598 | + */ |
|
| 599 | + public function get_options() { |
|
| 600 | + _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->get()' ); |
|
| 601 | + |
|
| 602 | + $this->options_class->get(); |
|
| 603 | + } |
|
| 604 | + |
|
| 605 | + /** |
|
| 606 | + * SHIM: _default_values |
|
| 607 | + * |
|
| 608 | + * @return array |
|
| 609 | + * |
|
| 610 | + * @deprecated 4.0.0 |
|
| 611 | + */ |
|
| 612 | + public function _default_values() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 613 | + _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->default_values()' ); |
|
| 614 | + |
|
| 615 | + return $this->default_values(); |
|
| 616 | + } |
|
| 617 | + |
|
| 618 | + /** |
|
| 619 | + * Get default values. |
|
| 620 | + * |
|
| 621 | + * @return array |
|
| 622 | + */ |
|
| 623 | + public function default_values() { |
|
| 624 | + if ( ! isset( $this->options_class ) ) { |
|
| 625 | + $this->options_defaults_class = new Redux_Options_Defaults(); |
|
| 626 | + $this->options_class = new Redux_Options_Constructor( $this ); |
|
| 627 | + } |
|
| 628 | + |
|
| 629 | + return $this->options_class->default_values(); |
|
| 630 | + } |
|
| 631 | + |
|
| 632 | + /** |
|
| 633 | + * SHIM: check_dependencies |
|
| 634 | + * |
|
| 635 | + * @param array $field Field array. |
|
| 636 | + * |
|
| 637 | + * @deprecated 4.0.0 |
|
| 638 | + */ |
|
| 639 | + public function check_dependencies( array $field ) { |
|
| 640 | + _deprecated_function( __FUNCTION__, '4.0.0', 'required_class->check_dependencies( $field )' ); |
|
| 641 | + |
|
| 642 | + $this->required_class->check_dependencies( $field ); |
|
| 643 | + } |
|
| 644 | + |
|
| 645 | + /** |
|
| 646 | + * SHIM: _enqueue_output |
|
| 647 | + * |
|
| 648 | + * @throws ReflectionException Exception. |
|
| 649 | + * |
|
| 650 | + * @deprecated 4.0.0 |
|
| 651 | + */ |
|
| 652 | + public function _enqueue_output() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 653 | + _deprecated_function( __FUNCTION__, '4.0.0', 'output_class->enqueue()' ); |
|
| 654 | + |
|
| 655 | + if ( empty( $this->output_class ) ) { |
|
| 656 | + $obj = new ReduxFramework( $this->sections, $this->args ); |
|
| 657 | + $obj->options = $this->options; |
|
| 658 | + $obj->output_class->enqueue(); |
|
| 659 | + $this->outputCSS = $obj->outputCSS; // phpcs:ignore WordPress.NamingConventions.ValidVariableName |
|
| 660 | + } else { |
|
| 661 | + $this->output_class->enqueue(); |
|
| 662 | + } |
|
| 663 | + } |
|
| 664 | + |
|
| 665 | + /** |
|
| 666 | + * SHIM: _enqueue |
|
| 667 | + * |
|
| 668 | + * @deprecated 4.0.0 |
|
| 669 | + */ |
|
| 670 | + public function _enqueue() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 671 | + _deprecated_function( __FUNCTION__, '4.0.0', 'enqueue_class->init()' ); |
|
| 672 | + |
|
| 673 | + $this->enqueue_class->init(); |
|
| 674 | + } |
|
| 675 | + |
|
| 676 | + /** |
|
| 677 | + * _enqueue replacement. |
|
| 678 | + * |
|
| 679 | + * @return void |
|
| 680 | + */ |
|
| 681 | + public function init_enqueue() { |
|
| 682 | + $this->enqueue_class->init(); |
|
| 683 | + } |
|
| 684 | + |
|
| 685 | + /** |
|
| 686 | + * SHIM: generate_panel |
|
| 687 | + * |
|
| 688 | + * @since 1.0.0 |
|
| 689 | + * @access public |
|
| 690 | + * @return void |
|
| 691 | + * |
|
| 692 | + * @deprecated 4.0.0 |
|
| 693 | + */ |
|
| 694 | + public function generate_panel() { |
|
| 695 | + _deprecated_function( __FUNCTION__, '4.0.0', 'render_class->generate_panel()' ); |
|
| 696 | + |
|
| 697 | + $this->render_class->generate_panel(); |
|
| 698 | + } |
|
| 699 | + |
|
| 700 | + /** |
|
| 701 | + * SHIM: get_default_values |
|
| 702 | + * |
|
| 703 | + * @param string $key Key value. |
|
| 704 | + * @param bool $array_key Flag to determine array status. |
|
| 705 | + * |
|
| 706 | + * @return array |
|
| 707 | + * |
|
| 708 | + * @deprecated 4.0.0 |
|
| 709 | + */ |
|
| 710 | + public function get_default_values( $key, $array_key = false ) { |
|
| 711 | + _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->get_default_value( $key, $array_key )' ); |
|
| 712 | + |
|
| 713 | + if ( ! isset( $this->options_class ) ) { |
|
| 714 | + $this->options_defaults_class = new Redux_Options_Defaults(); |
|
| 715 | + $this->options_class = new Redux_Options_Constructor( $this ); |
|
| 716 | + } |
|
| 717 | + |
|
| 718 | + return $this->options_class->get_default_value( $key, $array_key ); |
|
| 719 | + } |
|
| 720 | + |
|
| 721 | + /** |
|
| 722 | + * SHIM: get_default_value |
|
| 723 | + * |
|
| 724 | + * @param string $key Key value. |
|
| 725 | + * @param bool $array_key Flag to determine array status. |
|
| 726 | + * |
|
| 727 | + * @return array |
|
| 728 | + * |
|
| 729 | + * @deprecated 4.0.0 |
|
| 730 | + */ |
|
| 731 | + public function get_default_value( $key, $array_key = false ) { |
|
| 732 | + _deprecated_function( __FUNCTION__, '4.0.0', 'options_class->get_default_value( $key, $array_key )' ); |
|
| 733 | + |
|
| 734 | + if ( ! isset( $this->options_class ) ) { |
|
| 735 | + $this->options_defaults_class = new Redux_Options_Defaults(); |
|
| 736 | + $this->options_class = new Redux_Options_Constructor( $this ); |
|
| 737 | + } |
|
| 738 | + |
|
| 739 | + return $this->options_class->get_default_value( $key, $array_key ); |
|
| 740 | + } |
|
| 741 | + |
|
| 742 | + /** |
|
| 743 | + * SHIM: get_wordpress_data |
|
| 744 | + * |
|
| 745 | + * @param bool $type data type. |
|
| 746 | + * @param array $args args to pass to WordPress API. |
|
| 747 | + * @param string|array $current_value Current value. |
|
| 748 | + * |
|
| 749 | + * @return array|mixed|string|void |
|
| 750 | + * |
|
| 751 | + * @deprecated 4.0.0 |
|
| 752 | + */ |
|
| 753 | + public function get_wordpress_data( $type = false, $args = array(), $current_value = null ) { |
|
| 754 | + _deprecated_function( __FUNCTION__, '4.0.0', 'wordpress_data->get( $type, $args, $opt_name, $value )' ); |
|
| 755 | + |
|
| 756 | + return $this->wordpress_data->get( $type, $args, $this->args['opt_name'], $current_value ); |
|
| 757 | + } |
|
| 758 | + |
|
| 759 | + /** |
|
| 760 | + * SHIM: _validate_values |
|
| 761 | + * |
|
| 762 | + * @param array $plugin_options Current panel options. |
|
| 763 | + * @param array $options Options to validate. |
|
| 764 | + * @param array $sections Sections array. |
|
| 765 | + * |
|
| 766 | + * @return array |
|
| 767 | + * |
|
| 768 | + * @deprecated 4.0.0 |
|
| 769 | + */ |
|
| 770 | + public function _validate_values( $plugin_options, $options, $sections ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
|
| 771 | + _deprecated_function( __FUNCTION__, '4.0.0', 'validate_class->validate( $plugin_options, $options, $sections )' ); |
|
| 772 | + |
|
| 773 | + if ( ! isset( $this->validate_class ) ) { |
|
| 774 | + $this->validate_class = new Redux_Validation( $this ); |
|
| 775 | + } |
|
| 776 | + |
|
| 777 | + return $this->validate_class->validate( $plugin_options, $options, $sections ); |
|
| 778 | + } |
|
| 779 | + |
|
| 780 | + /** |
|
| 781 | + * SHIM: set_transients |
|
| 782 | + * |
|
| 783 | + * @return void |
|
| 784 | + * |
|
| 785 | + * @deprecated 4.0.0 |
|
| 786 | + */ |
|
| 787 | + public function set_transients() { |
|
| 788 | + _deprecated_function( __FUNCTION__, '4.0.0', 'Please update the extension that uses this deprecated function.' ); |
|
| 789 | + } |
|
| 790 | + |
|
| 791 | + /** |
|
| 792 | + * SHIM: section_menu |
|
| 793 | + * |
|
| 794 | + * @param int $k Array Key. |
|
| 795 | + * @param array $section Section array. |
|
| 796 | + * @param string $suffix Unique string. |
|
| 797 | + * @param array $sections Section array. |
|
| 798 | + * |
|
| 799 | + * @return string |
|
| 800 | + * |
|
| 801 | + * @deprecated 4.0.0 |
|
| 802 | + */ |
|
| 803 | + public function section_menu( $k, $section, $suffix = '', $sections = array() ) { |
|
| 804 | + _deprecated_function( __FUNCTION__, '4.0.0', 'render_class->section_menu( $index, $section, $suffix, $sections )' ); |
|
| 805 | + |
|
| 806 | + return $this->render_class->section_menu( $k, $section, $suffix, $sections ); |
|
| 807 | + } |
|
| 808 | + |
|
| 809 | + /** |
|
| 810 | + * SHIM: get_header_html |
|
| 811 | + * |
|
| 812 | + * @param array $field Field array. |
|
| 813 | + * |
|
| 814 | + * @return string |
|
| 815 | + * |
|
| 816 | + * @deprecated 4.0.0 |
|
| 817 | + */ |
|
| 818 | + public function get_header_html( $field ) { |
|
| 819 | + _deprecated_function( __FUNCTION__, '4.0.0', 'render_class->get_header_html( $field )' ); |
|
| 820 | + |
|
| 821 | + return $this->render_class->get_header_html( $field ); |
|
| 822 | + } |
|
| 823 | + |
|
| 824 | + /** |
|
| 825 | + * SHIM: current_user_can |
|
| 826 | + * |
|
| 827 | + * @param string $permission User permission. |
|
| 828 | + * |
|
| 829 | + * @return bool |
|
| 830 | + * |
|
| 831 | + * @deprecated 4.0.0 |
|
| 832 | + */ |
|
| 833 | + public function current_user_can( $permission ) { |
|
| 834 | + _deprecated_function( __FUNCTION__, '4.0.0', 'Redux_Helpers::current_user_can' ); |
|
| 835 | + |
|
| 836 | + return Redux_Helpers::current_user_can( $permission ); |
|
| 837 | + } |
|
| 838 | + |
|
| 839 | + /** |
|
| 840 | + * End backward compatibility shims for Redux v3 configs and extensions. |
|
| 841 | + */ |
|
| 842 | + |
|
| 843 | + /** |
|
| 844 | + * Pointer to the ReduxFramework instance. |
|
| 845 | + * |
|
| 846 | + * @return ReduxFramework|null |
|
| 847 | + */ |
|
| 848 | + public function get_instance(): ?ReduxFramework { |
|
| 849 | + return self::$instance; |
|
| 850 | + } |
|
| 851 | + |
|
| 852 | + /** |
|
| 853 | + * →get(); This is used to return and option value from the option array |
|
| 854 | + * |
|
| 855 | + * @since 1.0.0 |
|
| 856 | + * @access public |
|
| 857 | + * |
|
| 858 | + * @param string $opt_name The option name to return. |
|
| 859 | + * @param mixed $defaults (null) The value to return if an option isn't set. |
|
| 860 | + * |
|
| 861 | + * @return mixed |
|
| 862 | + */ |
|
| 863 | + public function get( string $opt_name, $defaults = null ) { |
|
| 864 | + return ( ! empty( $this->options[ $opt_name ] ) ) ? $this->options[ $opt_name ] : $this->options_class->get_default( $opt_name, $defaults ); |
|
| 865 | + } |
|
| 866 | + |
|
| 867 | + /** |
|
| 868 | + * →set(); This is used to set an arbitrary option in the option array |
|
| 869 | + * |
|
| 870 | + * @since 1.0.0 |
|
| 871 | + * @access public |
|
| 872 | + * |
|
| 873 | + * @param string $opt_name The name of the option being added. |
|
| 874 | + * @param mixed $values The value of the option being added. |
|
| 875 | + * |
|
| 876 | + * @return void |
|
| 877 | + */ |
|
| 878 | + public function set( string $opt_name = '', $values = array() ) { |
|
| 879 | + if ( ! empty( $opt_name ) && is_array( $values ) ) { |
|
| 880 | + $this->options[ $opt_name ] = $values; |
|
| 881 | + $this->options_class->set( $values ); |
|
| 882 | + } |
|
| 883 | + } |
|
| 884 | + } |
|
| 885 | + |
|
| 886 | + ReduxFramework::init(); |
|
| 887 | + |
|
| 888 | + /** |
|
| 889 | + * Action 'redux/init' |
|
| 890 | + */ |
|
| 891 | + do_action( 'redux/init' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 892 | 892 | } |
@@ -13,45 +13,45 @@ discard block |
||
| 13 | 13 | // Don't duplicate me! |
| 14 | 14 | if ( ! class_exists( 'Redux_Ace_Editor', false ) ) { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Class Redux_Ace_Editor |
|
| 18 | - */ |
|
| 19 | - class Redux_Ace_Editor extends Redux_Field { |
|
| 16 | + /** |
|
| 17 | + * Class Redux_Ace_Editor |
|
| 18 | + */ |
|
| 19 | + class Redux_Ace_Editor extends Redux_Field { |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * Field Render Function. |
|
| 23 | - * Takes the vars and outputs the HTML for the field in the settings |
|
| 24 | - * |
|
| 25 | - * @since ReduxFramework 1.0.0 |
|
| 26 | - */ |
|
| 27 | - public function render() { |
|
| 28 | - if ( is_array( $this->value ) ) { |
|
| 29 | - $this->value = ''; |
|
| 30 | - } else { |
|
| 31 | - $this->value = trim( $this->value ); |
|
| 32 | - } |
|
| 21 | + /** |
|
| 22 | + * Field Render Function. |
|
| 23 | + * Takes the vars and outputs the HTML for the field in the settings |
|
| 24 | + * |
|
| 25 | + * @since ReduxFramework 1.0.0 |
|
| 26 | + */ |
|
| 27 | + public function render() { |
|
| 28 | + if ( is_array( $this->value ) ) { |
|
| 29 | + $this->value = ''; |
|
| 30 | + } else { |
|
| 31 | + $this->value = trim( $this->value ); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - if ( ! empty( $this->field['options'] ) ) { |
|
| 35 | - $this->field['args'] = $this->field['options']; |
|
| 36 | - unset( $this->field['options'] ); |
|
| 37 | - } |
|
| 34 | + if ( ! empty( $this->field['options'] ) ) { |
|
| 35 | + $this->field['args'] = $this->field['options']; |
|
| 36 | + unset( $this->field['options'] ); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - if ( ! isset( $this->field['mode'] ) ) { |
|
| 40 | - $this->field['mode'] = 'javascript'; |
|
| 41 | - } |
|
| 42 | - if ( ! isset( $this->field['theme'] ) ) { |
|
| 43 | - $this->field['theme'] = 'monokai'; |
|
| 44 | - } |
|
| 39 | + if ( ! isset( $this->field['mode'] ) ) { |
|
| 40 | + $this->field['mode'] = 'javascript'; |
|
| 41 | + } |
|
| 42 | + if ( ! isset( $this->field['theme'] ) ) { |
|
| 43 | + $this->field['theme'] = 'monokai'; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - $params = array( |
|
| 47 | - 'minLines' => 10, |
|
| 48 | - 'maxLines' => 30, |
|
| 49 | - ); |
|
| 46 | + $params = array( |
|
| 47 | + 'minLines' => 10, |
|
| 48 | + 'maxLines' => 30, |
|
| 49 | + ); |
|
| 50 | 50 | |
| 51 | - if ( isset( $this->field['args'] ) && ! empty( $this->field['args'] ) && is_array( $this->field['args'] ) ) { |
|
| 52 | - $params = wp_parse_args( $this->field['args'], $params ); |
|
| 53 | - } |
|
| 54 | - ?> |
|
| 51 | + if ( isset( $this->field['args'] ) && ! empty( $this->field['args'] ) && is_array( $this->field['args'] ) ) { |
|
| 52 | + $params = wp_parse_args( $this->field['args'], $params ); |
|
| 53 | + } |
|
| 54 | + ?> |
|
| 55 | 55 | <div class="ace-wrapper"> |
| 56 | 56 | <input |
| 57 | 57 | type="hidden" |
@@ -70,46 +70,46 @@ discard block |
||
| 70 | 70 | class="ace-editor-area"><?php echo esc_html( $this->value ); ?></pre> |
| 71 | 71 | </div> |
| 72 | 72 | <?php |
| 73 | - } |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * Enqueue Function. |
|
| 77 | - * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 78 | - * |
|
| 79 | - * @since 1.0.0 |
|
| 80 | - * @access public |
|
| 81 | - * @return void |
|
| 82 | - */ |
|
| 83 | - public function enqueue() { |
|
| 84 | - if ( $this->parent->args['dev_mode'] ) { |
|
| 85 | - wp_enqueue_style( |
|
| 86 | - 'redux-field-ace-editor', |
|
| 87 | - Redux_Core::$url . 'inc/fields/ace_editor/redux-ace-editor.css', |
|
| 88 | - array(), |
|
| 89 | - $this->timestamp |
|
| 90 | - ); |
|
| 91 | - } |
|
| 75 | + /** |
|
| 76 | + * Enqueue Function. |
|
| 77 | + * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 78 | + * |
|
| 79 | + * @since 1.0.0 |
|
| 80 | + * @access public |
|
| 81 | + * @return void |
|
| 82 | + */ |
|
| 83 | + public function enqueue() { |
|
| 84 | + if ( $this->parent->args['dev_mode'] ) { |
|
| 85 | + wp_enqueue_style( |
|
| 86 | + 'redux-field-ace-editor', |
|
| 87 | + Redux_Core::$url . 'inc/fields/ace_editor/redux-ace-editor.css', |
|
| 88 | + array(), |
|
| 89 | + $this->timestamp |
|
| 90 | + ); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - if ( ! wp_script_is( 'ace-editor-js' ) ) { |
|
| 94 | - wp_enqueue_script( |
|
| 95 | - 'ace-editor-js', |
|
| 96 | - // phpcs:ignore Generic.Strings.UnnecessaryStringConcat |
|
| 97 | - apply_filters( 'redux/' . $this->parent->args['opt_name'] . 'fields/ace/script', '//' . 'cdnjs' . '.cloudflare' . '.com/ajax/libs/ace/1.23.0/ace.min.js' ), |
|
| 98 | - array( 'jquery' ), |
|
| 99 | - '1.23.0', |
|
| 100 | - true |
|
| 101 | - ); |
|
| 102 | - } |
|
| 93 | + if ( ! wp_script_is( 'ace-editor-js' ) ) { |
|
| 94 | + wp_enqueue_script( |
|
| 95 | + 'ace-editor-js', |
|
| 96 | + // phpcs:ignore Generic.Strings.UnnecessaryStringConcat |
|
| 97 | + apply_filters( 'redux/' . $this->parent->args['opt_name'] . 'fields/ace/script', '//' . 'cdnjs' . '.cloudflare' . '.com/ajax/libs/ace/1.23.0/ace.min.js' ), |
|
| 98 | + array( 'jquery' ), |
|
| 99 | + '1.23.0', |
|
| 100 | + true |
|
| 101 | + ); |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - wp_enqueue_script( |
|
| 105 | - 'redux-field-ace-editor', |
|
| 106 | - Redux_Core::$url . 'inc/fields/ace_editor/redux-ace-editor' . Redux_Functions::is_min() . '.js', |
|
| 107 | - array( 'jquery', 'ace-editor-js', 'redux-js' ), |
|
| 108 | - $this->timestamp, |
|
| 109 | - true |
|
| 110 | - ); |
|
| 111 | - } |
|
| 112 | - } |
|
| 104 | + wp_enqueue_script( |
|
| 105 | + 'redux-field-ace-editor', |
|
| 106 | + Redux_Core::$url . 'inc/fields/ace_editor/redux-ace-editor' . Redux_Functions::is_min() . '.js', |
|
| 107 | + array( 'jquery', 'ace-editor-js', 'redux-js' ), |
|
| 108 | + $this->timestamp, |
|
| 109 | + true |
|
| 110 | + ); |
|
| 111 | + } |
|
| 112 | + } |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | class_alias( 'Redux_Ace_Editor', 'ReduxFramework_Ace_Editor' ); |
@@ -8,111 +8,111 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | - exit; |
|
| 11 | + exit; |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | if ( ! class_exists( 'Redux_Welcome', false ) ) { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Class Redux_Welcome |
|
| 18 | - */ |
|
| 19 | - class Redux_Welcome { |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * Min capacity. |
|
| 23 | - * |
|
| 24 | - * @var string The capability users should have to view the page |
|
| 25 | - */ |
|
| 26 | - public string $minimum_capability = 'manage_options'; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * Display version. |
|
| 30 | - * |
|
| 31 | - * @var string |
|
| 32 | - */ |
|
| 33 | - public string $display_version = ''; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Is loaded. |
|
| 37 | - * |
|
| 38 | - * @var bool |
|
| 39 | - */ |
|
| 40 | - public bool $redux_loaded = false; |
|
| 41 | - |
|
| 42 | - /** |
|
| 43 | - * Get things started |
|
| 44 | - * |
|
| 45 | - * @since 1.4 |
|
| 46 | - */ |
|
| 47 | - public function __construct() { |
|
| 48 | - // Load the welcome page even if a Redux panel isn't running. |
|
| 49 | - add_action( 'init', array( $this, 'init' ), 999 ); |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * Class init. |
|
| 54 | - */ |
|
| 55 | - public function init() { |
|
| 56 | - if ( $this->redux_loaded ) { |
|
| 57 | - return; |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - $this->redux_loaded = true; |
|
| 61 | - add_action( 'admin_menu', array( $this, 'admin_menus' ) ); |
|
| 62 | - |
|
| 63 | - if ( isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification |
|
| 64 | - if ( 'redux-' === substr( sanitize_text_field( wp_unslash( $_GET['page'] ) ), 0, 6 ) ) { // phpcs:ignore WordPress.Security.NonceVerification |
|
| 65 | - $version = explode( '.', Redux_Core::$version ); |
|
| 66 | - $this->display_version = $version[0] . '.' . $version[1]; |
|
| 67 | - add_filter( 'admin_footer_text', array( $this, 'change_wp_footer' ) ); |
|
| 68 | - add_action( 'admin_head', array( $this, 'admin_head' ) ); |
|
| 69 | - } |
|
| 70 | - } |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * Do Redirect. |
|
| 75 | - */ |
|
| 76 | - public function do_redirect() { |
|
| 77 | - if ( ! defined( 'WP_CLI' ) ) { |
|
| 78 | - wp_safe_redirect( esc_url( admin_url( add_query_arg( array( 'page' => 'redux-framework' ), 'options-general.php' ) ) ) ); |
|
| 79 | - exit(); |
|
| 80 | - } |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - /** |
|
| 84 | - * Change Footer. |
|
| 85 | - */ |
|
| 86 | - public function change_wp_footer() { |
|
| 87 | - echo esc_html__( 'If you like', 'redux-framework' ) . ' <strong>Redux</strong> ' . esc_html__( 'please leave us a', 'redux-framework' ) . ' <a href="https://wordpress.org/support/view/plugin-reviews/redux-framework?filter=5#postform" target="_blank" class="redux-rating-link" data-rated="Thanks :)">★★★★★</a> ' . esc_html__( 'rating. A huge thank you in advance!', 'redux-framework' ); |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - |
|
| 91 | - |
|
| 92 | - /** |
|
| 93 | - * Register the Dashboard Pages which are later hidden but these pages |
|
| 94 | - * are used to render the What's Redux pages. |
|
| 95 | - * |
|
| 96 | - * @access public |
|
| 97 | - * @since 1.4 |
|
| 98 | - * @return void |
|
| 99 | - */ |
|
| 100 | - public function admin_menus() { |
|
| 101 | - $page = 'add_options_page'; |
|
| 102 | - |
|
| 103 | - // About Page. |
|
| 104 | - $page( esc_html__( 'What is Redux Framework?', 'redux-framework' ), esc_html__( 'Redux', 'redux-framework' ), $this->minimum_capability, 'redux-framework', array( $this, 'about_screen' ) ); |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Hide Individual Dashboard Pages |
|
| 109 | - * |
|
| 110 | - * @access public |
|
| 111 | - * @since 1.4 |
|
| 112 | - * @return void |
|
| 113 | - */ |
|
| 114 | - public function admin_head() { |
|
| 115 | - ?> |
|
| 16 | + /** |
|
| 17 | + * Class Redux_Welcome |
|
| 18 | + */ |
|
| 19 | + class Redux_Welcome { |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * Min capacity. |
|
| 23 | + * |
|
| 24 | + * @var string The capability users should have to view the page |
|
| 25 | + */ |
|
| 26 | + public string $minimum_capability = 'manage_options'; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * Display version. |
|
| 30 | + * |
|
| 31 | + * @var string |
|
| 32 | + */ |
|
| 33 | + public string $display_version = ''; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Is loaded. |
|
| 37 | + * |
|
| 38 | + * @var bool |
|
| 39 | + */ |
|
| 40 | + public bool $redux_loaded = false; |
|
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * Get things started |
|
| 44 | + * |
|
| 45 | + * @since 1.4 |
|
| 46 | + */ |
|
| 47 | + public function __construct() { |
|
| 48 | + // Load the welcome page even if a Redux panel isn't running. |
|
| 49 | + add_action( 'init', array( $this, 'init' ), 999 ); |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * Class init. |
|
| 54 | + */ |
|
| 55 | + public function init() { |
|
| 56 | + if ( $this->redux_loaded ) { |
|
| 57 | + return; |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + $this->redux_loaded = true; |
|
| 61 | + add_action( 'admin_menu', array( $this, 'admin_menus' ) ); |
|
| 62 | + |
|
| 63 | + if ( isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification |
|
| 64 | + if ( 'redux-' === substr( sanitize_text_field( wp_unslash( $_GET['page'] ) ), 0, 6 ) ) { // phpcs:ignore WordPress.Security.NonceVerification |
|
| 65 | + $version = explode( '.', Redux_Core::$version ); |
|
| 66 | + $this->display_version = $version[0] . '.' . $version[1]; |
|
| 67 | + add_filter( 'admin_footer_text', array( $this, 'change_wp_footer' ) ); |
|
| 68 | + add_action( 'admin_head', array( $this, 'admin_head' ) ); |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * Do Redirect. |
|
| 75 | + */ |
|
| 76 | + public function do_redirect() { |
|
| 77 | + if ( ! defined( 'WP_CLI' ) ) { |
|
| 78 | + wp_safe_redirect( esc_url( admin_url( add_query_arg( array( 'page' => 'redux-framework' ), 'options-general.php' ) ) ) ); |
|
| 79 | + exit(); |
|
| 80 | + } |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * Change Footer. |
|
| 85 | + */ |
|
| 86 | + public function change_wp_footer() { |
|
| 87 | + echo esc_html__( 'If you like', 'redux-framework' ) . ' <strong>Redux</strong> ' . esc_html__( 'please leave us a', 'redux-framework' ) . ' <a href="https://wordpress.org/support/view/plugin-reviews/redux-framework?filter=5#postform" target="_blank" class="redux-rating-link" data-rated="Thanks :)">★★★★★</a> ' . esc_html__( 'rating. A huge thank you in advance!', 'redux-framework' ); |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + |
|
| 91 | + |
|
| 92 | + /** |
|
| 93 | + * Register the Dashboard Pages which are later hidden but these pages |
|
| 94 | + * are used to render the What's Redux pages. |
|
| 95 | + * |
|
| 96 | + * @access public |
|
| 97 | + * @since 1.4 |
|
| 98 | + * @return void |
|
| 99 | + */ |
|
| 100 | + public function admin_menus() { |
|
| 101 | + $page = 'add_options_page'; |
|
| 102 | + |
|
| 103 | + // About Page. |
|
| 104 | + $page( esc_html__( 'What is Redux Framework?', 'redux-framework' ), esc_html__( 'Redux', 'redux-framework' ), $this->minimum_capability, 'redux-framework', array( $this, 'about_screen' ) ); |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Hide Individual Dashboard Pages |
|
| 109 | + * |
|
| 110 | + * @access public |
|
| 111 | + * @since 1.4 |
|
| 112 | + * @return void |
|
| 113 | + */ |
|
| 114 | + public function admin_head() { |
|
| 115 | + ?> |
|
| 116 | 116 | <link |
| 117 | 117 | rel='stylesheet' id='elusive-icons' <?php // phpcs:ignore WordPress.WP.EnqueuedResources ?> |
| 118 | 118 | href='<?php echo esc_url( Redux_Core::$url ); ?>assets/css/vendor/elusive-icons.css' |
@@ -133,19 +133,19 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | </style> |
| 135 | 135 | <?php |
| 136 | - } |
|
| 137 | - |
|
| 138 | - /** |
|
| 139 | - * Navigation tabs |
|
| 140 | - * |
|
| 141 | - * @access public |
|
| 142 | - * @since 1.9 |
|
| 143 | - * @return void |
|
| 144 | - */ |
|
| 145 | - public function tabs() { |
|
| 146 | - $selected = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : 'redux-framework'; // phpcs:ignore WordPress.Security.NonceVerification |
|
| 147 | - |
|
| 148 | - ?> |
|
| 136 | + } |
|
| 137 | + |
|
| 138 | + /** |
|
| 139 | + * Navigation tabs |
|
| 140 | + * |
|
| 141 | + * @access public |
|
| 142 | + * @since 1.9 |
|
| 143 | + * @return void |
|
| 144 | + */ |
|
| 145 | + public function tabs() { |
|
| 146 | + $selected = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : 'redux-framework'; // phpcs:ignore WordPress.Security.NonceVerification |
|
| 147 | + |
|
| 148 | + ?> |
|
| 149 | 149 | <h2 class="nav-tab-wrapper"> |
| 150 | 150 | <a |
| 151 | 151 | class="nav-tab <?php echo( 'redux-framework' === $selected ? 'nav-tab-active' : '' ); ?>" |
@@ -154,27 +154,27 @@ discard block |
||
| 154 | 154 | </a> |
| 155 | 155 | </h2> |
| 156 | 156 | <?php |
| 157 | - } |
|
| 158 | - |
|
| 159 | - /** |
|
| 160 | - * Render About Screen |
|
| 161 | - * |
|
| 162 | - * @access public |
|
| 163 | - * @since 1.4 |
|
| 164 | - * @return void |
|
| 165 | - */ |
|
| 166 | - public function about_screen() { |
|
| 167 | - // Stupid hack for WordPress alerts and warnings. |
|
| 168 | - echo '<div class="wrap" style="height:0;overflow:hidden;"><h2></h2></div>'; |
|
| 169 | - |
|
| 170 | - require_once 'views/about.php'; |
|
| 171 | - } |
|
| 172 | - |
|
| 173 | - /** |
|
| 174 | - * Action. |
|
| 175 | - */ |
|
| 176 | - public function actions() { |
|
| 177 | - ?> |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + /** |
|
| 160 | + * Render About Screen |
|
| 161 | + * |
|
| 162 | + * @access public |
|
| 163 | + * @since 1.4 |
|
| 164 | + * @return void |
|
| 165 | + */ |
|
| 166 | + public function about_screen() { |
|
| 167 | + // Stupid hack for WordPress alerts and warnings. |
|
| 168 | + echo '<div class="wrap" style="height:0;overflow:hidden;"><h2></h2></div>'; |
|
| 169 | + |
|
| 170 | + require_once 'views/about.php'; |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + /** |
|
| 174 | + * Action. |
|
| 175 | + */ |
|
| 176 | + public function actions() { |
|
| 177 | + ?> |
|
| 178 | 178 | <p class="redux-actions"> |
| 179 | 179 | <a href="https://devs.redux.io/" class="docs button button-primary">Docs</a> |
| 180 | 180 | <a |
@@ -189,30 +189,30 @@ discard block |
||
| 189 | 189 | data-via="ReduxFramework" data-size="large" data-hashtags="Redux">Tweet</a> |
| 190 | 190 | <?php |
| 191 | 191 | |
| 192 | - $options = Redux_Helpers::get_plugin_options(); |
|
| 193 | - $nonce = wp_create_nonce( 'redux_framework_demo' ); |
|
| 192 | + $options = Redux_Helpers::get_plugin_options(); |
|
| 193 | + $nonce = wp_create_nonce( 'redux_framework_demo' ); |
|
| 194 | 194 | |
| 195 | - $query_args = array( |
|
| 196 | - 'page' => 'redux-framework', |
|
| 197 | - 'redux-framework-plugin' => 'demo', |
|
| 198 | - 'nonce' => $nonce, |
|
| 199 | - ); |
|
| 195 | + $query_args = array( |
|
| 196 | + 'page' => 'redux-framework', |
|
| 197 | + 'redux-framework-plugin' => 'demo', |
|
| 198 | + 'nonce' => $nonce, |
|
| 199 | + ); |
|
| 200 | 200 | |
| 201 | - if ( $options['demo'] ) { |
|
| 202 | - ?> |
|
| 201 | + if ( $options['demo'] ) { |
|
| 202 | + ?> |
|
| 203 | 203 | <a |
| 204 | 204 | href="<?php echo esc_url( admin_url( add_query_arg( $query_args, 'options-general.php' ) ) ); ?>" |
| 205 | 205 | class=" button-text button-demo"><?php echo esc_html__( 'Disable Panel Demo', 'redux-framework' ); ?></a> |
| 206 | 206 | <?php |
| 207 | - } else { |
|
| 208 | - ?> |
|
| 207 | + } else { |
|
| 208 | + ?> |
|
| 209 | 209 | <a |
| 210 | 210 | href="<?php echo esc_url( admin_url( add_query_arg( $query_args, 'options-general.php' ) ) ); ?>" |
| 211 | 211 | class=" button-text button-demo active"><?php echo esc_html__( 'Enable Panel Demo', 'redux-framework' ); ?></a> |
| 212 | 212 | <?php |
| 213 | - } |
|
| 213 | + } |
|
| 214 | 214 | |
| 215 | - ?> |
|
| 215 | + ?> |
|
| 216 | 216 | <script> |
| 217 | 217 | !function( d, s, id ) { |
| 218 | 218 | let js; |
@@ -229,6 +229,6 @@ discard block |
||
| 229 | 229 | </script> |
| 230 | 230 | </p> |
| 231 | 231 | <?php |
| 232 | - } |
|
| 233 | - } |
|
| 232 | + } |
|
| 233 | + } |
|
| 234 | 234 | } |
@@ -14,67 +14,67 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Redux_Embedded implements themecheck { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Error array. |
|
| 19 | - * |
|
| 20 | - * @var array |
|
| 21 | - */ |
|
| 22 | - protected array $error = array(); |
|
| 17 | + /** |
|
| 18 | + * Error array. |
|
| 19 | + * |
|
| 20 | + * @var array |
|
| 21 | + */ |
|
| 22 | + protected array $error = array(); |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Run checker. |
|
| 26 | - * |
|
| 27 | - * @param array $php_files - Files to check. |
|
| 28 | - * @param array $css_files - Files to check. |
|
| 29 | - * @param array $other_files - Files to check. |
|
| 30 | - * |
|
| 31 | - * @return bool |
|
| 32 | - */ |
|
| 33 | - public function check( $php_files, $css_files, $other_files ): bool { |
|
| 24 | + /** |
|
| 25 | + * Run checker. |
|
| 26 | + * |
|
| 27 | + * @param array $php_files - Files to check. |
|
| 28 | + * @param array $css_files - Files to check. |
|
| 29 | + * @param array $other_files - Files to check. |
|
| 30 | + * |
|
| 31 | + * @return bool |
|
| 32 | + */ |
|
| 33 | + public function check( $php_files, $css_files, $other_files ): bool { |
|
| 34 | 34 | |
| 35 | - $ret = true; |
|
| 36 | - $check = Redux_ThemeCheck::get_instance(); |
|
| 37 | - $redux = $check::get_redux_details( $php_files ); |
|
| 35 | + $ret = true; |
|
| 36 | + $check = Redux_ThemeCheck::get_instance(); |
|
| 37 | + $redux = $check::get_redux_details( $php_files ); |
|
| 38 | 38 | |
| 39 | - if ( $redux ) { |
|
| 40 | - checkcount(); |
|
| 39 | + if ( $redux ) { |
|
| 40 | + checkcount(); |
|
| 41 | 41 | |
| 42 | - if ( ! isset( $_POST['redux_wporg'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification |
|
| 43 | - $this->error[] = '<div class="redux-error">' . sprintf( '<span class="tc-lead tc-recommended">' . esc_html__( 'RECOMMENDED', 'redux-framework' ) . '</span>: ' . esc_html__( 'If you are submitting to WordPress.org Theme Repository, it is', 'redux-framework' ) . ' <strong>' . esc_html__( 'strongly', 'redux-framework' ) . '</strong> ' . esc_html__( 'suggested that you read', 'redux-framework' ) . ' <a href="%s" target="_blank">' . esc_html__( 'this document', 'redux-framework' ) . '</a>, ' . esc_html__( 'or your theme will be rejected because of Redux.', 'redux-framework' ), 'https://docsv3.redux.io/core/wordpress-org-submissions/' ) . '</div>'; |
|
| 44 | - $ret = false; |
|
| 45 | - } else { |
|
| 46 | - // TODO Granular WP.org tests!!! |
|
| 47 | - // Check for Tracking. |
|
| 48 | - $tracking = $redux['dir'] . 'inc/tracking.php'; |
|
| 49 | - if ( file_exists( $tracking ) ) { |
|
| 50 | - $this->error[] = '<div class="redux-error">' . sprintf( '<span class="tc-lead tc-required">' . esc_html__( 'REQUIRED', 'redux-framework' ) . '</span>: ' . esc_html__( 'You MUST delete', 'redux-framework' ) . ' <strong> %s </strong>, ' . esc_html__( 'or your theme will be rejected by WP.org theme submission because of Redux.', 'redux-framework' ), $tracking ) . '</div>'; |
|
| 51 | - $ret = false; |
|
| 52 | - } |
|
| 42 | + if ( ! isset( $_POST['redux_wporg'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification |
|
| 43 | + $this->error[] = '<div class="redux-error">' . sprintf( '<span class="tc-lead tc-recommended">' . esc_html__( 'RECOMMENDED', 'redux-framework' ) . '</span>: ' . esc_html__( 'If you are submitting to WordPress.org Theme Repository, it is', 'redux-framework' ) . ' <strong>' . esc_html__( 'strongly', 'redux-framework' ) . '</strong> ' . esc_html__( 'suggested that you read', 'redux-framework' ) . ' <a href="%s" target="_blank">' . esc_html__( 'this document', 'redux-framework' ) . '</a>, ' . esc_html__( 'or your theme will be rejected because of Redux.', 'redux-framework' ), 'https://docsv3.redux.io/core/wordpress-org-submissions/' ) . '</div>'; |
|
| 44 | + $ret = false; |
|
| 45 | + } else { |
|
| 46 | + // TODO Granular WP.org tests!!! |
|
| 47 | + // Check for Tracking. |
|
| 48 | + $tracking = $redux['dir'] . 'inc/tracking.php'; |
|
| 49 | + if ( file_exists( $tracking ) ) { |
|
| 50 | + $this->error[] = '<div class="redux-error">' . sprintf( '<span class="tc-lead tc-required">' . esc_html__( 'REQUIRED', 'redux-framework' ) . '</span>: ' . esc_html__( 'You MUST delete', 'redux-framework' ) . ' <strong> %s </strong>, ' . esc_html__( 'or your theme will be rejected by WP.org theme submission because of Redux.', 'redux-framework' ), $tracking ) . '</div>'; |
|
| 51 | + $ret = false; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - // Embedded CDN package |
|
| 55 | - // use_cdn |
|
| 56 | - // Arguments. |
|
| 57 | - $args = '<ol>'; |
|
| 58 | - $args .= "<li><code>'save_defaults' => false</code></li>"; |
|
| 59 | - $args .= "<li><code>'use_cdn' => false</code></li>"; |
|
| 60 | - $args .= "<li><code>'customizer_only' => true</code> Non-Customizer Based Panels are Prohibited within WP.org Themes</li>"; |
|
| 61 | - $args .= "<li><code>'database' => 'theme_mods'</code> (' . esc_html__( 'Optional', 'redux-framework' ) . ')</li>"; |
|
| 62 | - $args .= '</ol>'; |
|
| 63 | - $this->error[] = '<div class="redux-error"><span class="tc-lead tc-recommended">' . esc_html__( 'RECOMMENDED', 'redux-framework' ) . '</span>: ' . esc_html__( 'The following arguments MUST be used for WP.org submissions, or you will be rejected because of your Redux configuration.', 'redux-framework' ) . $args . '</div>'; |
|
| 64 | - } |
|
| 65 | - } |
|
| 54 | + // Embedded CDN package |
|
| 55 | + // use_cdn |
|
| 56 | + // Arguments. |
|
| 57 | + $args = '<ol>'; |
|
| 58 | + $args .= "<li><code>'save_defaults' => false</code></li>"; |
|
| 59 | + $args .= "<li><code>'use_cdn' => false</code></li>"; |
|
| 60 | + $args .= "<li><code>'customizer_only' => true</code> Non-Customizer Based Panels are Prohibited within WP.org Themes</li>"; |
|
| 61 | + $args .= "<li><code>'database' => 'theme_mods'</code> (' . esc_html__( 'Optional', 'redux-framework' ) . ')</li>"; |
|
| 62 | + $args .= '</ol>'; |
|
| 63 | + $this->error[] = '<div class="redux-error"><span class="tc-lead tc-recommended">' . esc_html__( 'RECOMMENDED', 'redux-framework' ) . '</span>: ' . esc_html__( 'The following arguments MUST be used for WP.org submissions, or you will be rejected because of your Redux configuration.', 'redux-framework' ) . $args . '</div>'; |
|
| 64 | + } |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - return $ret; |
|
| 68 | - } |
|
| 67 | + return $ret; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * Return error array. |
|
| 72 | - * |
|
| 73 | - * @return array |
|
| 74 | - */ |
|
| 75 | - public function getError(): array { |
|
| 76 | - return $this->error; |
|
| 77 | - } |
|
| 70 | + /** |
|
| 71 | + * Return error array. |
|
| 72 | + * |
|
| 73 | + * @return array |
|
| 74 | + */ |
|
| 75 | + public function getError(): array { |
|
| 76 | + return $this->error; |
|
| 77 | + } |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $themechecks[] = new Redux_Embedded(); |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | * @return ReduxFramework ReduxFramework |
| 18 | 18 | */ |
| 19 | 19 | function get_redux_instance( string $opt_name ): ReduxFramework { |
| 20 | - _deprecated_function( __FUNCTION__, '4.0', 'Redux::instance($opt_name)' ); |
|
| 20 | + _deprecated_function( __FUNCTION__, '4.0', 'Redux::instance($opt_name)' ); |
|
| 21 | 21 | |
| 22 | - return Redux::instance( $opt_name ); |
|
| 22 | + return Redux::instance( $opt_name ); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @return array format ['opt_name' => $ReduxFramework] |
| 31 | 31 | */ |
| 32 | 32 | function get_all_redux_instances(): array { |
| 33 | - _deprecated_function( __FUNCTION__, '4.0', 'Redux::all_instances()' ); |
|
| 33 | + _deprecated_function( __FUNCTION__, '4.0', 'Redux::all_instances()' ); |
|
| 34 | 34 | |
| 35 | - return Redux::all_instances(); |
|
| 35 | + return Redux::all_instances(); |
|
| 36 | 36 | } |
@@ -16,304 +16,304 @@ |
||
| 16 | 16 | * @return array |
| 17 | 17 | */ |
| 18 | 18 | function redux_get_font_icons(): array { |
| 19 | - return array( |
|
| 20 | - 'el el-address-book-alt', |
|
| 21 | - 'el el-address-book', |
|
| 22 | - 'el el-adjust-alt', |
|
| 23 | - 'el el-adjust', |
|
| 24 | - 'el el-adult', |
|
| 25 | - 'el el-align-center', |
|
| 26 | - 'el el-align-justify', |
|
| 27 | - 'el el-align-left', |
|
| 28 | - 'el el-align-right', |
|
| 29 | - 'el el-arrow-down', |
|
| 30 | - 'el el-arrow-left', |
|
| 31 | - 'el el-arrow-right', |
|
| 32 | - 'el el-arrow-up', |
|
| 33 | - 'el el-asl', |
|
| 34 | - 'el el-asterisk', |
|
| 35 | - 'el el-backward', |
|
| 36 | - 'el el-ban-circle', |
|
| 37 | - 'el el-barcode', |
|
| 38 | - 'el el-behance', |
|
| 39 | - 'el el-bell', |
|
| 40 | - 'el el-blind', |
|
| 41 | - 'el el-blogger', |
|
| 42 | - 'el el-bold', |
|
| 43 | - 'el el-book', |
|
| 44 | - 'el el-bookmark-empty', |
|
| 45 | - 'el el-bookmark', |
|
| 46 | - 'el el-braille', |
|
| 47 | - 'el el-briefcase', |
|
| 48 | - 'el el-broom', |
|
| 49 | - 'el el-brush', |
|
| 50 | - 'el el-bulb', |
|
| 51 | - 'el el-bullhorn', |
|
| 52 | - 'el el-calendar-sign', |
|
| 53 | - 'el el-calendar', |
|
| 54 | - 'el el-camera', |
|
| 55 | - 'el el-car', |
|
| 56 | - 'el el-caret-down', |
|
| 57 | - 'el el-caret-left', |
|
| 58 | - 'el el-caret-right', |
|
| 59 | - 'el el-caret-up', |
|
| 60 | - 'el el-cc', |
|
| 61 | - 'el el-certificate', |
|
| 62 | - 'el el-check-empty', |
|
| 63 | - 'el el-check', |
|
| 64 | - 'el el-chevron-down', |
|
| 65 | - 'el el-chevron-left', |
|
| 66 | - 'el el-chevron-right', |
|
| 67 | - 'el el-chevron-up', |
|
| 68 | - 'el el-child', |
|
| 69 | - 'el el-circle-arrow-down', |
|
| 70 | - 'el el-circle-arrow-left', |
|
| 71 | - 'el el-circle-arrow-right', |
|
| 72 | - 'el el-circle-arrow-up', |
|
| 73 | - 'el el-cloud-alt', |
|
| 74 | - 'el el-cloud', |
|
| 75 | - 'el el-cog-alt', |
|
| 76 | - 'el el-cog', |
|
| 77 | - 'el el-cogs', |
|
| 78 | - 'el el-comment-alt', |
|
| 79 | - 'el el-comment', |
|
| 80 | - 'el el-compass-alt', |
|
| 81 | - 'el el-compass', |
|
| 82 | - 'el el-credit-card', |
|
| 83 | - 'el el-css', |
|
| 84 | - 'el el-dashboard', |
|
| 85 | - 'el el-delicious', |
|
| 86 | - 'el el-deviantart', |
|
| 87 | - 'el el-digg', |
|
| 88 | - 'el el-download-alt', |
|
| 89 | - 'el el-download', |
|
| 90 | - 'el el-dribbble', |
|
| 91 | - 'el el-edit', |
|
| 92 | - 'el el-eject', |
|
| 93 | - 'el el-envelope-alt', |
|
| 94 | - 'el el-envelope', |
|
| 95 | - 'el el-error-alt', |
|
| 96 | - 'el el-error', |
|
| 97 | - 'el el-eur', |
|
| 98 | - 'el el-exclamation-sign', |
|
| 99 | - 'el el-eye-close', |
|
| 100 | - 'el el-eye-open', |
|
| 101 | - 'el el-facebook', |
|
| 102 | - 'el el-facetime-video', |
|
| 103 | - 'el el-fast-backward', |
|
| 104 | - 'el el-fast-forward', |
|
| 105 | - 'el el-female', |
|
| 106 | - 'el el-file-alt', |
|
| 107 | - 'el el-file-edit-alt', |
|
| 108 | - 'el el-file-edit', |
|
| 109 | - 'el el-file-new-alt', |
|
| 110 | - 'el el-file-new', |
|
| 111 | - 'el el-file', |
|
| 112 | - 'el el-film', |
|
| 113 | - 'el el-filter', |
|
| 114 | - 'el el-fire', |
|
| 115 | - 'el el-flag-alt', |
|
| 116 | - 'el el-flag', |
|
| 117 | - 'el el-flickr', |
|
| 118 | - 'el el-folder-close', |
|
| 119 | - 'el el-folder-open', |
|
| 120 | - 'el el-folder-sign', |
|
| 121 | - 'el el-folder', |
|
| 122 | - 'el el-font', |
|
| 123 | - 'el el-fontsize', |
|
| 124 | - 'el el-fork', |
|
| 125 | - 'el el-forward-alt', |
|
| 126 | - 'el el-forward', |
|
| 127 | - 'el el-foursquare', |
|
| 128 | - 'el el-friendfeed-rect', |
|
| 129 | - 'el el-friendfeed', |
|
| 130 | - 'el el-fullscreen', |
|
| 131 | - 'el el-gbp', |
|
| 132 | - 'el el-gift', |
|
| 133 | - 'el el-github-text', |
|
| 134 | - 'el el-github', |
|
| 135 | - 'el el-glass', |
|
| 136 | - 'el el-glasses', |
|
| 137 | - 'el el-globe-alt', |
|
| 138 | - 'el el-globe', |
|
| 139 | - 'el el-googleplus', |
|
| 140 | - 'el el-graph-alt', |
|
| 141 | - 'el el-graph', |
|
| 142 | - 'el el-group-alt', |
|
| 143 | - 'el el-group', |
|
| 144 | - 'el el-guidedog', |
|
| 145 | - 'el el-hand-down', |
|
| 146 | - 'el el-hand-left', |
|
| 147 | - 'el el-hand-right', |
|
| 148 | - 'el el-hand-up', |
|
| 149 | - 'el el-hdd', |
|
| 150 | - 'el el-headphones', |
|
| 151 | - 'el el-hearing-impaired', |
|
| 152 | - 'el el-heart-alt', |
|
| 153 | - 'el el-heart-empty', |
|
| 154 | - 'el el-heart', |
|
| 155 | - 'el el-home-alt', |
|
| 156 | - 'el el-home', |
|
| 157 | - 'el el-hourglass', |
|
| 158 | - 'el el-idea-alt', |
|
| 159 | - 'el el-idea', |
|
| 160 | - 'el el-inbox-alt', |
|
| 161 | - 'el el-inbox-box', |
|
| 162 | - 'el el-inbox', |
|
| 163 | - 'el el-indent-left', |
|
| 164 | - 'el el-indent-right', |
|
| 165 | - 'el el-info-circle', |
|
| 166 | - 'el el-instagram', |
|
| 167 | - 'el el-iphone-home', |
|
| 168 | - 'el el-italic', |
|
| 169 | - 'el el-key', |
|
| 170 | - 'el el-laptop-alt', |
|
| 171 | - 'el el-laptop', |
|
| 172 | - 'el el-lastfm', |
|
| 173 | - 'el el-leaf', |
|
| 174 | - 'el el-lines', |
|
| 175 | - 'el el-link', |
|
| 176 | - 'el el-linkedin', |
|
| 177 | - 'el el-list-alt', |
|
| 178 | - 'el el-list', |
|
| 179 | - 'el el-livejournal', |
|
| 180 | - 'el el-lock-alt', |
|
| 181 | - 'el el-lock', |
|
| 182 | - 'el el-magic', |
|
| 183 | - 'el el-magnet', |
|
| 184 | - 'el el-male', |
|
| 185 | - 'el el-map-marker-alt', |
|
| 186 | - 'el el-map-marker', |
|
| 187 | - 'el el-mic-alt', |
|
| 188 | - 'el el-mic', |
|
| 189 | - 'el el-minus-sign', |
|
| 190 | - 'el el-minus', |
|
| 191 | - 'el el-move', |
|
| 192 | - 'el el-music', |
|
| 193 | - 'el el-myspace', |
|
| 194 | - 'el el-network', |
|
| 195 | - 'el el-off', |
|
| 196 | - 'el el-ok-circle', |
|
| 197 | - 'el el-ok-sign', |
|
| 198 | - 'el el-ok', |
|
| 199 | - 'el el-opensource', |
|
| 200 | - 'el el-paper-clip-alt', |
|
| 201 | - 'el el-paper-clip', |
|
| 202 | - 'el el-path', |
|
| 203 | - 'el el-pause-alt', |
|
| 204 | - 'el el-pause', |
|
| 205 | - 'el el-pencil-alt', |
|
| 206 | - 'el el-pencil', |
|
| 207 | - 'el el-person', |
|
| 208 | - 'el el-phone-alt', |
|
| 209 | - 'el el-phone', |
|
| 210 | - 'el el-photo-alt', |
|
| 211 | - 'el el-photo', |
|
| 212 | - 'el el-picasa', |
|
| 213 | - 'el el-picture', |
|
| 214 | - 'el el-plane', |
|
| 215 | - 'el el-play-alt', |
|
| 216 | - 'el el-play-circle', |
|
| 217 | - 'el el-play', |
|
| 218 | - 'el el-plus-sign', |
|
| 219 | - 'el el-plus', |
|
| 220 | - 'el el-podcast', |
|
| 221 | - 'el el-print', |
|
| 222 | - 'el el-puzzle', |
|
| 223 | - 'el el-qrcode', |
|
| 224 | - 'el el-question-sign', |
|
| 225 | - 'el el-question', |
|
| 226 | - 'el el-quote-alt', |
|
| 227 | - 'el el-quotes', |
|
| 228 | - 'el el-random', |
|
| 229 | - 'el el-record', |
|
| 230 | - 'el el-reddit', |
|
| 231 | - 'el el-refresh', |
|
| 232 | - 'el el-remove-circle', |
|
| 233 | - 'el el-remove-sign', |
|
| 234 | - 'el el-remove', |
|
| 235 | - 'el el-repeat-alt', |
|
| 236 | - 'el el-repeat', |
|
| 237 | - 'el el-resize-full', |
|
| 238 | - 'el el-resize-horizontal', |
|
| 239 | - 'el el-resize-small', |
|
| 240 | - 'el el-resize-vertical', |
|
| 241 | - 'el el-return-key', |
|
| 242 | - 'el el-retweet', |
|
| 243 | - 'el el-reverse-alt', |
|
| 244 | - 'el el-road', |
|
| 245 | - 'el el-rss', |
|
| 246 | - 'el el-scissors', |
|
| 247 | - 'el el-screen-alt', |
|
| 248 | - 'el el-screen', |
|
| 249 | - 'el el-screenshot', |
|
| 250 | - 'el el-search-alt', |
|
| 251 | - 'el el-search', |
|
| 252 | - 'el el-share-alt', |
|
| 253 | - 'el el-share', |
|
| 254 | - 'el el-shopping-cart-sign', |
|
| 255 | - 'el el-shopping-cart', |
|
| 256 | - 'el el-signal', |
|
| 257 | - 'el el-skype', |
|
| 258 | - 'el el-slideshare', |
|
| 259 | - 'el el-smiley-alt', |
|
| 260 | - 'el el-smiley', |
|
| 261 | - 'el el-soundcloud', |
|
| 262 | - 'el el-speaker', |
|
| 263 | - 'el el-spotify', |
|
| 264 | - 'el el-stackoverflow', |
|
| 265 | - 'el el-star-alt', |
|
| 266 | - 'el el-star-empty', |
|
| 267 | - 'el el-star', |
|
| 268 | - 'el el-step-backward', |
|
| 269 | - 'el el-step-forward', |
|
| 270 | - 'el el-stop-alt', |
|
| 271 | - 'el el-stop', |
|
| 272 | - 'el el-stumbleupon', |
|
| 273 | - 'el el-tag', |
|
| 274 | - 'el el-tags', |
|
| 275 | - 'el el-tasks', |
|
| 276 | - 'el el-text-height', |
|
| 277 | - 'el el-text-width', |
|
| 278 | - 'el el-th-large', |
|
| 279 | - 'el el-th-list', |
|
| 280 | - 'el el-th', |
|
| 281 | - 'el el-thumbs-down', |
|
| 282 | - 'el el-thumbs-up', |
|
| 283 | - 'el el-time-alt', |
|
| 284 | - 'el el-time', |
|
| 285 | - 'el el-tint', |
|
| 286 | - 'el el-torso', |
|
| 287 | - 'el el-trash-alt', |
|
| 288 | - 'el el-trash', |
|
| 289 | - 'el el-tumblr', |
|
| 290 | - 'el el-twitter', |
|
| 291 | - 'el el-universal-access', |
|
| 292 | - 'el el-unlock-alt', |
|
| 293 | - 'el el-unlock', |
|
| 294 | - 'el el-upload', |
|
| 295 | - 'el el-usd', |
|
| 296 | - 'el el-user', |
|
| 297 | - 'el el-viadeo', |
|
| 298 | - 'el el-video-alt', |
|
| 299 | - 'el el-video-chat', |
|
| 300 | - 'el el-video', |
|
| 301 | - 'el el-view-mode', |
|
| 302 | - 'el el-vimeo', |
|
| 303 | - 'el el-vkontakte', |
|
| 304 | - 'el el-volume-down', |
|
| 305 | - 'el el-volume-off', |
|
| 306 | - 'el el-volume-up', |
|
| 307 | - 'el el-w3c', |
|
| 308 | - 'el el-warning-sign', |
|
| 309 | - 'el el-website-alt', |
|
| 310 | - 'el el-website', |
|
| 311 | - 'el el-wheelchair', |
|
| 312 | - 'el el-wordpress', |
|
| 313 | - 'el el-wrench-alt', |
|
| 314 | - 'el el-wrench', |
|
| 315 | - 'el el-youtube', |
|
| 316 | - 'el el-zoom-in', |
|
| 317 | - 'el el-zoom-out', |
|
| 318 | - ); |
|
| 19 | + return array( |
|
| 20 | + 'el el-address-book-alt', |
|
| 21 | + 'el el-address-book', |
|
| 22 | + 'el el-adjust-alt', |
|
| 23 | + 'el el-adjust', |
|
| 24 | + 'el el-adult', |
|
| 25 | + 'el el-align-center', |
|
| 26 | + 'el el-align-justify', |
|
| 27 | + 'el el-align-left', |
|
| 28 | + 'el el-align-right', |
|
| 29 | + 'el el-arrow-down', |
|
| 30 | + 'el el-arrow-left', |
|
| 31 | + 'el el-arrow-right', |
|
| 32 | + 'el el-arrow-up', |
|
| 33 | + 'el el-asl', |
|
| 34 | + 'el el-asterisk', |
|
| 35 | + 'el el-backward', |
|
| 36 | + 'el el-ban-circle', |
|
| 37 | + 'el el-barcode', |
|
| 38 | + 'el el-behance', |
|
| 39 | + 'el el-bell', |
|
| 40 | + 'el el-blind', |
|
| 41 | + 'el el-blogger', |
|
| 42 | + 'el el-bold', |
|
| 43 | + 'el el-book', |
|
| 44 | + 'el el-bookmark-empty', |
|
| 45 | + 'el el-bookmark', |
|
| 46 | + 'el el-braille', |
|
| 47 | + 'el el-briefcase', |
|
| 48 | + 'el el-broom', |
|
| 49 | + 'el el-brush', |
|
| 50 | + 'el el-bulb', |
|
| 51 | + 'el el-bullhorn', |
|
| 52 | + 'el el-calendar-sign', |
|
| 53 | + 'el el-calendar', |
|
| 54 | + 'el el-camera', |
|
| 55 | + 'el el-car', |
|
| 56 | + 'el el-caret-down', |
|
| 57 | + 'el el-caret-left', |
|
| 58 | + 'el el-caret-right', |
|
| 59 | + 'el el-caret-up', |
|
| 60 | + 'el el-cc', |
|
| 61 | + 'el el-certificate', |
|
| 62 | + 'el el-check-empty', |
|
| 63 | + 'el el-check', |
|
| 64 | + 'el el-chevron-down', |
|
| 65 | + 'el el-chevron-left', |
|
| 66 | + 'el el-chevron-right', |
|
| 67 | + 'el el-chevron-up', |
|
| 68 | + 'el el-child', |
|
| 69 | + 'el el-circle-arrow-down', |
|
| 70 | + 'el el-circle-arrow-left', |
|
| 71 | + 'el el-circle-arrow-right', |
|
| 72 | + 'el el-circle-arrow-up', |
|
| 73 | + 'el el-cloud-alt', |
|
| 74 | + 'el el-cloud', |
|
| 75 | + 'el el-cog-alt', |
|
| 76 | + 'el el-cog', |
|
| 77 | + 'el el-cogs', |
|
| 78 | + 'el el-comment-alt', |
|
| 79 | + 'el el-comment', |
|
| 80 | + 'el el-compass-alt', |
|
| 81 | + 'el el-compass', |
|
| 82 | + 'el el-credit-card', |
|
| 83 | + 'el el-css', |
|
| 84 | + 'el el-dashboard', |
|
| 85 | + 'el el-delicious', |
|
| 86 | + 'el el-deviantart', |
|
| 87 | + 'el el-digg', |
|
| 88 | + 'el el-download-alt', |
|
| 89 | + 'el el-download', |
|
| 90 | + 'el el-dribbble', |
|
| 91 | + 'el el-edit', |
|
| 92 | + 'el el-eject', |
|
| 93 | + 'el el-envelope-alt', |
|
| 94 | + 'el el-envelope', |
|
| 95 | + 'el el-error-alt', |
|
| 96 | + 'el el-error', |
|
| 97 | + 'el el-eur', |
|
| 98 | + 'el el-exclamation-sign', |
|
| 99 | + 'el el-eye-close', |
|
| 100 | + 'el el-eye-open', |
|
| 101 | + 'el el-facebook', |
|
| 102 | + 'el el-facetime-video', |
|
| 103 | + 'el el-fast-backward', |
|
| 104 | + 'el el-fast-forward', |
|
| 105 | + 'el el-female', |
|
| 106 | + 'el el-file-alt', |
|
| 107 | + 'el el-file-edit-alt', |
|
| 108 | + 'el el-file-edit', |
|
| 109 | + 'el el-file-new-alt', |
|
| 110 | + 'el el-file-new', |
|
| 111 | + 'el el-file', |
|
| 112 | + 'el el-film', |
|
| 113 | + 'el el-filter', |
|
| 114 | + 'el el-fire', |
|
| 115 | + 'el el-flag-alt', |
|
| 116 | + 'el el-flag', |
|
| 117 | + 'el el-flickr', |
|
| 118 | + 'el el-folder-close', |
|
| 119 | + 'el el-folder-open', |
|
| 120 | + 'el el-folder-sign', |
|
| 121 | + 'el el-folder', |
|
| 122 | + 'el el-font', |
|
| 123 | + 'el el-fontsize', |
|
| 124 | + 'el el-fork', |
|
| 125 | + 'el el-forward-alt', |
|
| 126 | + 'el el-forward', |
|
| 127 | + 'el el-foursquare', |
|
| 128 | + 'el el-friendfeed-rect', |
|
| 129 | + 'el el-friendfeed', |
|
| 130 | + 'el el-fullscreen', |
|
| 131 | + 'el el-gbp', |
|
| 132 | + 'el el-gift', |
|
| 133 | + 'el el-github-text', |
|
| 134 | + 'el el-github', |
|
| 135 | + 'el el-glass', |
|
| 136 | + 'el el-glasses', |
|
| 137 | + 'el el-globe-alt', |
|
| 138 | + 'el el-globe', |
|
| 139 | + 'el el-googleplus', |
|
| 140 | + 'el el-graph-alt', |
|
| 141 | + 'el el-graph', |
|
| 142 | + 'el el-group-alt', |
|
| 143 | + 'el el-group', |
|
| 144 | + 'el el-guidedog', |
|
| 145 | + 'el el-hand-down', |
|
| 146 | + 'el el-hand-left', |
|
| 147 | + 'el el-hand-right', |
|
| 148 | + 'el el-hand-up', |
|
| 149 | + 'el el-hdd', |
|
| 150 | + 'el el-headphones', |
|
| 151 | + 'el el-hearing-impaired', |
|
| 152 | + 'el el-heart-alt', |
|
| 153 | + 'el el-heart-empty', |
|
| 154 | + 'el el-heart', |
|
| 155 | + 'el el-home-alt', |
|
| 156 | + 'el el-home', |
|
| 157 | + 'el el-hourglass', |
|
| 158 | + 'el el-idea-alt', |
|
| 159 | + 'el el-idea', |
|
| 160 | + 'el el-inbox-alt', |
|
| 161 | + 'el el-inbox-box', |
|
| 162 | + 'el el-inbox', |
|
| 163 | + 'el el-indent-left', |
|
| 164 | + 'el el-indent-right', |
|
| 165 | + 'el el-info-circle', |
|
| 166 | + 'el el-instagram', |
|
| 167 | + 'el el-iphone-home', |
|
| 168 | + 'el el-italic', |
|
| 169 | + 'el el-key', |
|
| 170 | + 'el el-laptop-alt', |
|
| 171 | + 'el el-laptop', |
|
| 172 | + 'el el-lastfm', |
|
| 173 | + 'el el-leaf', |
|
| 174 | + 'el el-lines', |
|
| 175 | + 'el el-link', |
|
| 176 | + 'el el-linkedin', |
|
| 177 | + 'el el-list-alt', |
|
| 178 | + 'el el-list', |
|
| 179 | + 'el el-livejournal', |
|
| 180 | + 'el el-lock-alt', |
|
| 181 | + 'el el-lock', |
|
| 182 | + 'el el-magic', |
|
| 183 | + 'el el-magnet', |
|
| 184 | + 'el el-male', |
|
| 185 | + 'el el-map-marker-alt', |
|
| 186 | + 'el el-map-marker', |
|
| 187 | + 'el el-mic-alt', |
|
| 188 | + 'el el-mic', |
|
| 189 | + 'el el-minus-sign', |
|
| 190 | + 'el el-minus', |
|
| 191 | + 'el el-move', |
|
| 192 | + 'el el-music', |
|
| 193 | + 'el el-myspace', |
|
| 194 | + 'el el-network', |
|
| 195 | + 'el el-off', |
|
| 196 | + 'el el-ok-circle', |
|
| 197 | + 'el el-ok-sign', |
|
| 198 | + 'el el-ok', |
|
| 199 | + 'el el-opensource', |
|
| 200 | + 'el el-paper-clip-alt', |
|
| 201 | + 'el el-paper-clip', |
|
| 202 | + 'el el-path', |
|
| 203 | + 'el el-pause-alt', |
|
| 204 | + 'el el-pause', |
|
| 205 | + 'el el-pencil-alt', |
|
| 206 | + 'el el-pencil', |
|
| 207 | + 'el el-person', |
|
| 208 | + 'el el-phone-alt', |
|
| 209 | + 'el el-phone', |
|
| 210 | + 'el el-photo-alt', |
|
| 211 | + 'el el-photo', |
|
| 212 | + 'el el-picasa', |
|
| 213 | + 'el el-picture', |
|
| 214 | + 'el el-plane', |
|
| 215 | + 'el el-play-alt', |
|
| 216 | + 'el el-play-circle', |
|
| 217 | + 'el el-play', |
|
| 218 | + 'el el-plus-sign', |
|
| 219 | + 'el el-plus', |
|
| 220 | + 'el el-podcast', |
|
| 221 | + 'el el-print', |
|
| 222 | + 'el el-puzzle', |
|
| 223 | + 'el el-qrcode', |
|
| 224 | + 'el el-question-sign', |
|
| 225 | + 'el el-question', |
|
| 226 | + 'el el-quote-alt', |
|
| 227 | + 'el el-quotes', |
|
| 228 | + 'el el-random', |
|
| 229 | + 'el el-record', |
|
| 230 | + 'el el-reddit', |
|
| 231 | + 'el el-refresh', |
|
| 232 | + 'el el-remove-circle', |
|
| 233 | + 'el el-remove-sign', |
|
| 234 | + 'el el-remove', |
|
| 235 | + 'el el-repeat-alt', |
|
| 236 | + 'el el-repeat', |
|
| 237 | + 'el el-resize-full', |
|
| 238 | + 'el el-resize-horizontal', |
|
| 239 | + 'el el-resize-small', |
|
| 240 | + 'el el-resize-vertical', |
|
| 241 | + 'el el-return-key', |
|
| 242 | + 'el el-retweet', |
|
| 243 | + 'el el-reverse-alt', |
|
| 244 | + 'el el-road', |
|
| 245 | + 'el el-rss', |
|
| 246 | + 'el el-scissors', |
|
| 247 | + 'el el-screen-alt', |
|
| 248 | + 'el el-screen', |
|
| 249 | + 'el el-screenshot', |
|
| 250 | + 'el el-search-alt', |
|
| 251 | + 'el el-search', |
|
| 252 | + 'el el-share-alt', |
|
| 253 | + 'el el-share', |
|
| 254 | + 'el el-shopping-cart-sign', |
|
| 255 | + 'el el-shopping-cart', |
|
| 256 | + 'el el-signal', |
|
| 257 | + 'el el-skype', |
|
| 258 | + 'el el-slideshare', |
|
| 259 | + 'el el-smiley-alt', |
|
| 260 | + 'el el-smiley', |
|
| 261 | + 'el el-soundcloud', |
|
| 262 | + 'el el-speaker', |
|
| 263 | + 'el el-spotify', |
|
| 264 | + 'el el-stackoverflow', |
|
| 265 | + 'el el-star-alt', |
|
| 266 | + 'el el-star-empty', |
|
| 267 | + 'el el-star', |
|
| 268 | + 'el el-step-backward', |
|
| 269 | + 'el el-step-forward', |
|
| 270 | + 'el el-stop-alt', |
|
| 271 | + 'el el-stop', |
|
| 272 | + 'el el-stumbleupon', |
|
| 273 | + 'el el-tag', |
|
| 274 | + 'el el-tags', |
|
| 275 | + 'el el-tasks', |
|
| 276 | + 'el el-text-height', |
|
| 277 | + 'el el-text-width', |
|
| 278 | + 'el el-th-large', |
|
| 279 | + 'el el-th-list', |
|
| 280 | + 'el el-th', |
|
| 281 | + 'el el-thumbs-down', |
|
| 282 | + 'el el-thumbs-up', |
|
| 283 | + 'el el-time-alt', |
|
| 284 | + 'el el-time', |
|
| 285 | + 'el el-tint', |
|
| 286 | + 'el el-torso', |
|
| 287 | + 'el el-trash-alt', |
|
| 288 | + 'el el-trash', |
|
| 289 | + 'el el-tumblr', |
|
| 290 | + 'el el-twitter', |
|
| 291 | + 'el el-universal-access', |
|
| 292 | + 'el el-unlock-alt', |
|
| 293 | + 'el el-unlock', |
|
| 294 | + 'el el-upload', |
|
| 295 | + 'el el-usd', |
|
| 296 | + 'el el-user', |
|
| 297 | + 'el el-viadeo', |
|
| 298 | + 'el el-video-alt', |
|
| 299 | + 'el el-video-chat', |
|
| 300 | + 'el el-video', |
|
| 301 | + 'el el-view-mode', |
|
| 302 | + 'el el-vimeo', |
|
| 303 | + 'el el-vkontakte', |
|
| 304 | + 'el el-volume-down', |
|
| 305 | + 'el el-volume-off', |
|
| 306 | + 'el el-volume-up', |
|
| 307 | + 'el el-w3c', |
|
| 308 | + 'el el-warning-sign', |
|
| 309 | + 'el el-website-alt', |
|
| 310 | + 'el el-website', |
|
| 311 | + 'el el-wheelchair', |
|
| 312 | + 'el el-wordpress', |
|
| 313 | + 'el el-wrench-alt', |
|
| 314 | + 'el el-wrench', |
|
| 315 | + 'el el-youtube', |
|
| 316 | + 'el el-zoom-in', |
|
| 317 | + 'el el-zoom-out', |
|
| 318 | + ); |
|
| 319 | 319 | } |
@@ -11,81 +11,81 @@ |
||
| 11 | 11 | * @package altis/core |
| 12 | 12 | */ |
| 13 | 13 | class Redux_Autoloader { |
| 14 | - const NS_SEPARATOR = '\\'; |
|
| 14 | + const NS_SEPARATOR = '\\'; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Prefix to validate against. |
|
| 18 | - * |
|
| 19 | - * @var string |
|
| 20 | - */ |
|
| 21 | - protected string $prefix; |
|
| 16 | + /** |
|
| 17 | + * Prefix to validate against. |
|
| 18 | + * |
|
| 19 | + * @var string |
|
| 20 | + */ |
|
| 21 | + protected string $prefix; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * String length of the prefix. |
|
| 25 | - * |
|
| 26 | - * @var int |
|
| 27 | - */ |
|
| 28 | - protected int $prefix_length; |
|
| 23 | + /** |
|
| 24 | + * String length of the prefix. |
|
| 25 | + * |
|
| 26 | + * @var int |
|
| 27 | + */ |
|
| 28 | + protected int $prefix_length; |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Path to validate. |
|
| 32 | - * |
|
| 33 | - * @var string |
|
| 34 | - */ |
|
| 35 | - protected string $path; |
|
| 30 | + /** |
|
| 31 | + * Path to validate. |
|
| 32 | + * |
|
| 33 | + * @var string |
|
| 34 | + */ |
|
| 35 | + protected string $path; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Autoloader constructor. |
|
| 39 | - * |
|
| 40 | - * @param string $prefix Prefix to validate against. |
|
| 41 | - * @param string $path Path to validate. |
|
| 42 | - */ |
|
| 43 | - public function __construct( string $prefix, string $path ) { |
|
| 44 | - $this->prefix = $prefix; |
|
| 45 | - $this->prefix_length = strlen( $prefix ); |
|
| 46 | - $this->path = trailingslashit( $path ); |
|
| 47 | - } |
|
| 37 | + /** |
|
| 38 | + * Autoloader constructor. |
|
| 39 | + * |
|
| 40 | + * @param string $prefix Prefix to validate against. |
|
| 41 | + * @param string $path Path to validate. |
|
| 42 | + */ |
|
| 43 | + public function __construct( string $prefix, string $path ) { |
|
| 44 | + $this->prefix = $prefix; |
|
| 45 | + $this->prefix_length = strlen( $prefix ); |
|
| 46 | + $this->path = trailingslashit( $path ); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * Load a class file if it matches our criteria. |
|
| 51 | - * |
|
| 52 | - * @param string $classname Class to test and/or load. |
|
| 53 | - */ |
|
| 54 | - public function load( string $classname ) { |
|
| 55 | - if ( strpos( $classname, 'Redux' ) === false ) { |
|
| 56 | - return; |
|
| 57 | - } |
|
| 49 | + /** |
|
| 50 | + * Load a class file if it matches our criteria. |
|
| 51 | + * |
|
| 52 | + * @param string $classname Class to test and/or load. |
|
| 53 | + */ |
|
| 54 | + public function load( string $classname ) { |
|
| 55 | + if ( strpos( $classname, 'Redux' ) === false ) { |
|
| 56 | + return; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - // Strip prefix from the start (ala PSR-4). |
|
| 60 | - $classname = substr( $classname, $this->prefix_length + 1 ); |
|
| 61 | - if ( function_exists( 'mb_strtolower' ) && function_exists( 'mb_detect_encoding' ) ) { |
|
| 62 | - $classname = mb_strtolower( $classname, mb_detect_encoding( $classname ) ); |
|
| 63 | - } else { |
|
| 64 | - $classname = strtolower( $classname ); |
|
| 65 | - } |
|
| 59 | + // Strip prefix from the start (ala PSR-4). |
|
| 60 | + $classname = substr( $classname, $this->prefix_length + 1 ); |
|
| 61 | + if ( function_exists( 'mb_strtolower' ) && function_exists( 'mb_detect_encoding' ) ) { |
|
| 62 | + $classname = mb_strtolower( $classname, mb_detect_encoding( $classname ) ); |
|
| 63 | + } else { |
|
| 64 | + $classname = strtolower( $classname ); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - $file = ''; |
|
| 68 | - // Split on namespace separator. |
|
| 69 | - $last_ns_pos = strripos( $classname, self::NS_SEPARATOR ); |
|
| 70 | - if ( false !== $last_ns_pos ) { |
|
| 71 | - $namespace = substr( $classname, 0, $last_ns_pos ); |
|
| 72 | - $classname = substr( $classname, $last_ns_pos + 1 ); |
|
| 73 | - $file = str_replace( self::NS_SEPARATOR, DIRECTORY_SEPARATOR, $namespace ) . DIRECTORY_SEPARATOR; |
|
| 74 | - } |
|
| 75 | - $file_prefix = $file; |
|
| 76 | - $file = $file_prefix . 'class-' . str_replace( '_', '-', $classname ) . '.php'; |
|
| 67 | + $file = ''; |
|
| 68 | + // Split on namespace separator. |
|
| 69 | + $last_ns_pos = strripos( $classname, self::NS_SEPARATOR ); |
|
| 70 | + if ( false !== $last_ns_pos ) { |
|
| 71 | + $namespace = substr( $classname, 0, $last_ns_pos ); |
|
| 72 | + $classname = substr( $classname, $last_ns_pos + 1 ); |
|
| 73 | + $file = str_replace( self::NS_SEPARATOR, DIRECTORY_SEPARATOR, $namespace ) . DIRECTORY_SEPARATOR; |
|
| 74 | + } |
|
| 75 | + $file_prefix = $file; |
|
| 76 | + $file = $file_prefix . 'class-' . str_replace( '_', '-', $classname ) . '.php'; |
|
| 77 | 77 | |
| 78 | - $path = $this->path . $file; |
|
| 78 | + $path = $this->path . $file; |
|
| 79 | 79 | |
| 80 | - if ( file_exists( $path ) ) { |
|
| 81 | - require_once $path; |
|
| 82 | - } else { |
|
| 83 | - $file = $file_prefix . 'class-redux-' . str_replace( '_', '-', $classname ) . '.php'; |
|
| 84 | - $path = $this->path . $file; |
|
| 80 | + if ( file_exists( $path ) ) { |
|
| 81 | + require_once $path; |
|
| 82 | + } else { |
|
| 83 | + $file = $file_prefix . 'class-redux-' . str_replace( '_', '-', $classname ) . '.php'; |
|
| 84 | + $path = $this->path . $file; |
|
| 85 | 85 | |
| 86 | - if ( file_exists( $path ) ) { |
|
| 87 | - require_once $path; |
|
| 88 | - } |
|
| 89 | - } |
|
| 90 | - } |
|
| 86 | + if ( file_exists( $path ) ) { |
|
| 87 | + require_once $path; |
|
| 88 | + } |
|
| 89 | + } |
|
| 90 | + } |
|
| 91 | 91 | } |
@@ -12,82 +12,82 @@ |
||
| 12 | 12 | |
| 13 | 13 | if ( ! class_exists( 'Redux_Validation_Unique_Slug', false ) ) { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Class Redux_Validation_Unique_Slug |
|
| 17 | - */ |
|
| 18 | - class Redux_Validation_Unique_Slug extends Redux_Validate { |
|
| 19 | - |
|
| 20 | - /** |
|
| 21 | - * Field Validation Function. |
|
| 22 | - * Takes the vars and validates them |
|
| 23 | - * |
|
| 24 | - * @since ReduxFramework 3.0.0 |
|
| 25 | - */ |
|
| 26 | - public function validate() { |
|
| 27 | - global $wpdb, $wp_rewrite; |
|
| 28 | - |
|
| 29 | - $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'That URL slug is in use, please choose another.', 'redux-framework' ); |
|
| 30 | - $this->field['flush_permalinks'] = $this->field['flush_permalinks'] ?? false; |
|
| 31 | - |
|
| 32 | - $slug = $this->value; |
|
| 33 | - |
|
| 34 | - $post_name_check = ''; |
|
| 35 | - |
|
| 36 | - $feeds = $wp_rewrite->feeds; |
|
| 37 | - if ( ! is_array( $feeds ) ) { |
|
| 38 | - $feeds = array(); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - // Post slugs must be unique across all posts. |
|
| 42 | - $result = wp_cache_get( 'redux-post-name' ); |
|
| 43 | - if ( false === $result ) { |
|
| 44 | - // phpcs:ignore WordPress.DB.DirectDatabaseQuery |
|
| 45 | - $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = %s LIMIT 1", $slug ) ); |
|
| 46 | - |
|
| 47 | - wp_cache_set( 'redux-post-name', $post_name_check ); |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * Filter whether the post slug would be bad as a flat slug. |
|
| 52 | - * |
|
| 53 | - * @since 3.1.0 |
|
| 54 | - * |
|
| 55 | - * @param bool $bad_slug Whether the post slug would be bad as a flat slug. |
|
| 56 | - * @param string $slug The post slug. |
|
| 57 | - * @param string $post_type Post type. |
|
| 58 | - */ |
|
| 59 | - if ( $post_name_check || in_array( $slug, $feeds, true ) || apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug ) ) { |
|
| 60 | - $suffix = 2; |
|
| 61 | - |
|
| 62 | - do { |
|
| 63 | - $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; |
|
| 64 | - |
|
| 65 | - $result = wp_cache_get( 'redux-alt-post-name' ); |
|
| 66 | - if ( false === $result ) { |
|
| 67 | - // phpcs:ignore WordPress.DB.DirectDatabaseQuery |
|
| 68 | - $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = %s LIMIT 1", $alt_post_name ) ); |
|
| 69 | - |
|
| 70 | - wp_cache_set( 'redux-alt-post-name', $result ); |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - ++$suffix; |
|
| 74 | - } while ( $post_name_check ); |
|
| 75 | - |
|
| 76 | - $slug = $alt_post_name; |
|
| 77 | - $this->value = ( isset( $this->current ) ) ? $this->current : ''; |
|
| 78 | - $this->field['msg'] = sprintf( $this->field['msg'], $slug ); |
|
| 79 | - $this->field['current'] = $this->value; |
|
| 80 | - $this->error = $this->field; |
|
| 81 | - } elseif ( isset( $this->field['flush_permalinks'] ) && true === $this->field['flush_permalinks'] ) { |
|
| 82 | - add_action( 'init', array( $this, 'flush_permalinks' ), 99 ); |
|
| 83 | - } |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * Flush WordPress permalinks. |
|
| 88 | - */ |
|
| 89 | - public function flush_permalinks() { |
|
| 90 | - flush_rewrite_rules(); |
|
| 91 | - } |
|
| 92 | - } |
|
| 15 | + /** |
|
| 16 | + * Class Redux_Validation_Unique_Slug |
|
| 17 | + */ |
|
| 18 | + class Redux_Validation_Unique_Slug extends Redux_Validate { |
|
| 19 | + |
|
| 20 | + /** |
|
| 21 | + * Field Validation Function. |
|
| 22 | + * Takes the vars and validates them |
|
| 23 | + * |
|
| 24 | + * @since ReduxFramework 3.0.0 |
|
| 25 | + */ |
|
| 26 | + public function validate() { |
|
| 27 | + global $wpdb, $wp_rewrite; |
|
| 28 | + |
|
| 29 | + $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'That URL slug is in use, please choose another.', 'redux-framework' ); |
|
| 30 | + $this->field['flush_permalinks'] = $this->field['flush_permalinks'] ?? false; |
|
| 31 | + |
|
| 32 | + $slug = $this->value; |
|
| 33 | + |
|
| 34 | + $post_name_check = ''; |
|
| 35 | + |
|
| 36 | + $feeds = $wp_rewrite->feeds; |
|
| 37 | + if ( ! is_array( $feeds ) ) { |
|
| 38 | + $feeds = array(); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + // Post slugs must be unique across all posts. |
|
| 42 | + $result = wp_cache_get( 'redux-post-name' ); |
|
| 43 | + if ( false === $result ) { |
|
| 44 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery |
|
| 45 | + $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = %s LIMIT 1", $slug ) ); |
|
| 46 | + |
|
| 47 | + wp_cache_set( 'redux-post-name', $post_name_check ); |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * Filter whether the post slug would be bad as a flat slug. |
|
| 52 | + * |
|
| 53 | + * @since 3.1.0 |
|
| 54 | + * |
|
| 55 | + * @param bool $bad_slug Whether the post slug would be bad as a flat slug. |
|
| 56 | + * @param string $slug The post slug. |
|
| 57 | + * @param string $post_type Post type. |
|
| 58 | + */ |
|
| 59 | + if ( $post_name_check || in_array( $slug, $feeds, true ) || apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug ) ) { |
|
| 60 | + $suffix = 2; |
|
| 61 | + |
|
| 62 | + do { |
|
| 63 | + $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; |
|
| 64 | + |
|
| 65 | + $result = wp_cache_get( 'redux-alt-post-name' ); |
|
| 66 | + if ( false === $result ) { |
|
| 67 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery |
|
| 68 | + $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = %s LIMIT 1", $alt_post_name ) ); |
|
| 69 | + |
|
| 70 | + wp_cache_set( 'redux-alt-post-name', $result ); |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + ++$suffix; |
|
| 74 | + } while ( $post_name_check ); |
|
| 75 | + |
|
| 76 | + $slug = $alt_post_name; |
|
| 77 | + $this->value = ( isset( $this->current ) ) ? $this->current : ''; |
|
| 78 | + $this->field['msg'] = sprintf( $this->field['msg'], $slug ); |
|
| 79 | + $this->field['current'] = $this->value; |
|
| 80 | + $this->error = $this->field; |
|
| 81 | + } elseif ( isset( $this->field['flush_permalinks'] ) && true === $this->field['flush_permalinks'] ) { |
|
| 82 | + add_action( 'init', array( $this, 'flush_permalinks' ), 99 ); |
|
| 83 | + } |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * Flush WordPress permalinks. |
|
| 88 | + */ |
|
| 89 | + public function flush_permalinks() { |
|
| 90 | + flush_rewrite_rules(); |
|
| 91 | + } |
|
| 92 | + } |
|
| 93 | 93 | } |
@@ -12,32 +12,32 @@ |
||
| 12 | 12 | |
| 13 | 13 | if ( ! class_exists( 'Redux_Validation_No_Special_Chars', false ) ) { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Class Redux_Validation_No_Special_Chars |
|
| 17 | - */ |
|
| 18 | - class Redux_Validation_No_Special_Chars extends Redux_Validate { |
|
| 19 | - |
|
| 20 | - /** |
|
| 21 | - * Field Render Function. |
|
| 22 | - * Takes the vars and validates them |
|
| 23 | - * |
|
| 24 | - * @since ReduxFramework 1.0.0 |
|
| 25 | - */ |
|
| 26 | - public function validate() { |
|
| 27 | - $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must not enter any special characters in this field, all special characters have been removed.', 'redux-framework' ); |
|
| 28 | - |
|
| 29 | - $val = preg_match( '/[^a-zA-Z0-9_ -]/', $this->value ); |
|
| 30 | - |
|
| 31 | - if ( $val > 0 ) { |
|
| 32 | - $this->field['current'] = $this->current; |
|
| 33 | - |
|
| 34 | - $this->warning = $this->field; |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - $this->value = preg_replace( '/[^a-zA-Z0-9_ -]/', '', $this->value ); |
|
| 38 | - |
|
| 39 | - $this->field['current'] = $this->value; |
|
| 40 | - $this->sanitize = $this->field; |
|
| 41 | - } |
|
| 42 | - } |
|
| 15 | + /** |
|
| 16 | + * Class Redux_Validation_No_Special_Chars |
|
| 17 | + */ |
|
| 18 | + class Redux_Validation_No_Special_Chars extends Redux_Validate { |
|
| 19 | + |
|
| 20 | + /** |
|
| 21 | + * Field Render Function. |
|
| 22 | + * Takes the vars and validates them |
|
| 23 | + * |
|
| 24 | + * @since ReduxFramework 1.0.0 |
|
| 25 | + */ |
|
| 26 | + public function validate() { |
|
| 27 | + $this->field['msg'] = $this->field['msg'] ?? esc_html__( 'You must not enter any special characters in this field, all special characters have been removed.', 'redux-framework' ); |
|
| 28 | + |
|
| 29 | + $val = preg_match( '/[^a-zA-Z0-9_ -]/', $this->value ); |
|
| 30 | + |
|
| 31 | + if ( $val > 0 ) { |
|
| 32 | + $this->field['current'] = $this->current; |
|
| 33 | + |
|
| 34 | + $this->warning = $this->field; |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + $this->value = preg_replace( '/[^a-zA-Z0-9_ -]/', '', $this->value ); |
|
| 38 | + |
|
| 39 | + $this->field['current'] = $this->value; |
|
| 40 | + $this->sanitize = $this->field; |
|
| 41 | + } |
|
| 42 | + } |
|
| 43 | 43 | } |