| | 38 | /* |
| | 39 | * Until a proper _deprecated_option() function can be introduced, redirect requests |
| | 40 | * to deprecated keys to the new, correct ones. |
| | 41 | */ |
| | 42 | $deprecated_keys = array( |
| | 43 | 'blacklist_keys' => 'blocklist_keys', |
| | 44 | 'comment_whitelist' => 'comment_previously_approved', |
| | 45 | ); |
| | 46 | |
| | 47 | if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) { |
| | 48 | _doing_it_wrong( |
| | 49 | sprintf( |
| | 50 | __( '%s option' ), |
| | 51 | $option |
| | 52 | ), |
| | 53 | sprintf( |
| | 54 | __( 'This option key has been renamed to "%s".', '5.5.0' ), |
| | 55 | $deprecated_keys[ $option ] |
| | 56 | ), |
| | 57 | '5.5.0' |
| | 58 | ); |
| | 59 | return get_option( $deprecated_keys[ $option ], $default ); |
| | 60 | } |
| | 61 | |
| | 340 | /* |
| | 341 | * Until a proper _deprecated_option() function can be introduced, redirect requests |
| | 342 | * to deprecated keys to the new, correct ones. |
| | 343 | */ |
| | 344 | $deprecated_keys = array( |
| | 345 | 'blacklist_keys' => 'blocklist_keys', |
| | 346 | 'comment_whitelist' => 'comment_previously_approved', |
| | 347 | ); |
| | 348 | |
| | 349 | if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) { |
| | 350 | _doing_it_wrong( |
| | 351 | sprintf( |
| | 352 | __( '%s option' ), |
| | 353 | $option |
| | 354 | ), |
| | 355 | sprintf( |
| | 356 | __( 'This option key has been renamed to "%s".', '5.5.0' ), |
| | 357 | $deprecated_keys[ $option ] |
| | 358 | ), |
| | 359 | '5.5.0' |
| | 360 | ); |
| | 361 | return update_option( $deprecated_keys[ $option ], $value, $autoload ); |
| | 362 | } |
| | 363 | |
| | 528 | /* |
| | 529 | * Until a proper _deprecated_option() function can be introduced, redirect requests |
| | 530 | * to deprecated keys to the new, correct ones. |
| | 531 | */ |
| | 532 | $deprecated_keys = array( |
| | 533 | 'blacklist_keys' => 'blocklist_keys', |
| | 534 | 'comment_whitelist' => 'comment_previously_approved', |
| | 535 | ); |
| | 536 | |
| | 537 | if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) { |
| | 538 | _doing_it_wrong( |
| | 539 | sprintf( |
| | 540 | __( '%s option' ), |
| | 541 | $option |
| | 542 | ), |
| | 543 | sprintf( |
| | 544 | __( 'This option key has been renamed to "%s".', '5.5.0' ), |
| | 545 | $deprecated_keys[ $option ] |
| | 546 | ), |
| | 547 | '5.5.0' |
| | 548 | ); |
| | 549 | return add_option( $deprecated_keys[ $option ], $value, $deprecated, $autoload ); |
| | 550 | } |
| | 551 | |