Changeset 48575 for trunk/src/wp-includes/option.php
- Timestamp:
- 07/23/2020 03:12:49 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r48477 r48575 34 34 if ( empty( $option ) ) { 35 35 return false; 36 } 37 38 /* 39 * Until a proper _deprecated_option() function can be introduced, 40 * redirect requests to deprecated keys to the new, correct ones. 41 */ 42 $deprecated_keys = array( 43 'blacklist_keys' => 'disallowed_keys', 44 'comment_whitelist' => 'comment_previously_approved', 45 ); 46 47 if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) { 48 _deprecated_argument( 49 __FUNCTION__, 50 '5.5.0', 51 sprintf( 52 /* translators: 1: Deprecated option key, 2: New option key. */ 53 __( 'The "%1$s" option key has been renamed to "%2$s".' ), 54 $option, 55 $deprecated_keys[ $option ] 56 ) 57 ); 58 return get_option( $deprecated_keys[ $option ], $default ); 36 59 } 37 60 … … 314 337 } 315 338 339 /* 340 * Until a proper _deprecated_option() function can be introduced, 341 * redirect requests to deprecated keys to the new, correct ones. 342 */ 343 $deprecated_keys = array( 344 'blacklist_keys' => 'disallowed_keys', 345 'comment_whitelist' => 'comment_previously_approved', 346 ); 347 348 if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) { 349 _deprecated_argument( 350 __FUNCTION__, 351 '5.5.0', 352 sprintf( 353 /* translators: 1: Deprecated option key, 2: New option key. */ 354 __( 'The "%1$s" option key has been renamed to "%2$s".' ), 355 $option, 356 $deprecated_keys[ $option ] 357 ) 358 ); 359 return update_option( $deprecated_keys[ $option ], $value, $autoload ); 360 } 361 316 362 wp_protect_special_option( $option ); 317 363 … … 476 522 if ( empty( $option ) ) { 477 523 return false; 524 } 525 526 /* 527 * Until a proper _deprecated_option() function can be introduced, 528 * redirect requests to deprecated keys to the new, correct ones. 529 */ 530 $deprecated_keys = array( 531 'blacklist_keys' => 'disallowed_keys', 532 'comment_whitelist' => 'comment_previously_approved', 533 ); 534 535 if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) { 536 _deprecated_argument( 537 __FUNCTION__, 538 '5.5.0', 539 sprintf( 540 /* translators: 1: Deprecated option key, 2: New option key. */ 541 __( 'The "%1$s" option key has been renamed to "%2$s".' ), 542 $option, 543 $deprecated_keys[ $option ] 544 ) 545 ); 546 return add_option( $deprecated_keys[ $option ], $value, $deprecated, $autoload ); 478 547 } 479 548
Note: See TracChangeset
for help on using the changeset viewer.