Changeset 58949
- Timestamp:
- 08/28/2024 10:46:27 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r58811 r58949 376 376 * 377 377 * @since 6.4.0 378 * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated. 378 379 * 379 380 * @global wpdb $wpdb WordPress database abstraction object. 380 381 * 381 382 * @param array $options Associative array of option names and their autoload values to set. The option names are 382 * expected to not be SQL-escaped. The autoload values accept 'yes'|true to enable or 'no'|false383 * to disable.383 * expected to not be SQL-escaped. The autoload values should be boolean values. For backward 384 * compatibility 'yes' and 'no' are also accepted, though using these values is deprecated. 384 385 * @return array Associative array of all provided $options as keys and boolean values for whether their autoload value 385 386 * was updated. … … 399 400 foreach ( $options as $option => $autoload ) { 400 401 wp_protect_special_option( $option ); // Ensure only valid options can be passed. 401 if ( 'off' === $autoload || 'no' === $autoload || false === $autoload ) { // Sanitize autoload value and categorize accordingly. 402 403 /* 404 * Sanitize autoload value and categorize accordingly. 405 * The values 'yes', 'no', 'on', and 'off' are supported for backward compatibility. 406 */ 407 if ( 'off' === $autoload || 'no' === $autoload || false === $autoload ) { 402 408 $grouped_options['off'][] = $option; 403 409 } else { … … 497 503 * 498 504 * @since 6.4.0 505 * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated. 499 506 * 500 507 * @see wp_set_option_autoload_values() 501 508 * 502 * @param string[] $options List of option names. Expected to not be SQL-escaped. 503 * @param string|bool $autoload Autoload value to control whether to load the options when WordPress starts up. 504 * Accepts 'yes'|true to enable or 'no'|false to disable. 509 * @param string[] $options List of option names. Expected to not be SQL-escaped. 510 * @param bool $autoload Autoload value to control whether to load the options when WordPress starts up. 511 * For backward compatibility 'yes' and 'no' are also accepted, though using these values is 512 * deprecated. 505 513 * @return array Associative array of all provided $options as keys and boolean values for whether their autoload value 506 514 * was updated. … … 519 527 * 520 528 * @since 6.4.0 529 * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated. 521 530 * 522 531 * @see wp_set_option_autoload_values() 523 532 * 524 * @param string $option Name of the option. Expected to not be SQL-escaped. 525 * @param string|bool $autoload Autoload value to control whether to load the option when WordPress starts up. 526 * Accepts 'yes'|true to enable or 'no'|false to disable. 533 * @param string $option Name of the option. Expected to not be SQL-escaped. 534 * @param bool $autoload Autoload value to control whether to load the option when WordPress starts up. 535 * For backward compatibility 'yes' and 'no' are also accepted, though using these values is 536 * deprecated. 527 537 * @return bool True if the autoload value was modified, false otherwise. 528 538 */ … … 804 814 * @since 1.0.0 805 815 * @since 4.2.0 The `$autoload` parameter was added. 816 * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated. 806 817 * 807 818 * @global wpdb $wpdb WordPress database abstraction object. … … 810 821 * @param mixed $value Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped. 811 822 * @param bool|null $autoload Optional. Whether to load the option when WordPress starts up. 812 * Accepts a boolean, or `null` to stick with the initial value or, if no initial value is set, 813 * to leave the decision up to default heuristics in WordPress. 814 * For existing options, 815 * `$autoload` can only be updated using `update_option()` if `$value` is also changed. 816 * For backward compatibility 'yes' and 'no' are also accepted. 823 * Accepts a boolean, or `null` to stick with the initial value or, if no initial value is 824 * set, to leave the decision up to default heuristics in WordPress. 825 * For existing options, `$autoload` can only be updated using `update_option()` if `$value` 826 * is also changed. 827 * For backward compatibility 'yes' and 'no' are also accepted, though using these values is 828 * deprecated. 817 829 * Autoloading too many options can lead to performance problems, especially if the 818 830 * options are not frequently used. For options which are accessed across several places … … 1027 1039 * @since 1.0.0 1028 1040 * @since 6.6.0 The $autoload parameter's default value was changed to null. 1041 * @since 6.7.0 The autoload values 'yes' and 'no' are deprecated. 1029 1042 * 1030 1043 * @global wpdb $wpdb WordPress database abstraction object. … … 1035 1048 * @param string $deprecated Optional. Description. Not used anymore. 1036 1049 * @param bool|null $autoload Optional. Whether to load the option when WordPress starts up. 1037 * Accepts a boolean, or `null` to leave the decision up to default heuristics in WordPress. 1038 * For backward compatibility 'yes' and 'no' are also accepted. 1050 * Accepts a boolean, or `null` to leave the decision up to default heuristics in 1051 * WordPress. For backward compatibility 'yes' and 'no' are also accepted, though using 1052 * these values is deprecated. 1039 1053 * Autoloading too many options can lead to performance problems, especially if the 1040 1054 * options are not frequently used. For options which are accessed across several places 1041 * in the frontend, it is recommended to autoload them, by using 'yes'|true.1055 * in the frontend, it is recommended to autoload them, by using true. 1042 1056 * For options which are accessed only on few specific URLs, it is recommended 1043 1057 * to not autoload them, by using false.
Note: See TracChangeset
for help on using the changeset viewer.