Changeset 56717 for trunk/src/wp-includes/option.php
- Timestamp:
- 09/26/2023 03:53:39 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r56681 r56717 777 777 $value = apply_filters( 'pre_update_option', $value, $option, $old_value ); 778 778 779 /* 780 * To get the actual raw old value from the database, any existing pre filters need to be temporarily disabled. 781 * Immediately after getting the raw value, they are reinstated. 782 * The raw value is only used to determine whether a value is present in the database. It is not used anywhere 783 * else, and is not passed to any of the hooks either. 784 */ 785 if ( has_filter( "pre_option_{$option}" ) ) { 786 global $wp_filter; 787 788 $old_filters = $wp_filter[ "pre_option_{$option}" ]; 789 unset( $wp_filter[ "pre_option_{$option}" ] ); 790 791 $raw_old_value = get_option( $option ); 792 $wp_filter[ "pre_option_{$option}" ] = $old_filters; 793 } else { 794 $raw_old_value = $old_value; 795 } 796 779 797 /** This filter is documented in wp-includes/option.php */ 780 798 $default_value = apply_filters( "default_option_{$option}", false, $option, false ); … … 788 806 * See https://core.trac.wordpress.org/ticket/38903 and https://core.trac.wordpress.org/ticket/22192. 789 807 */ 790 if ( $ old_value !== $default_value && _is_equal_database_value( $old_value, $value ) ) {808 if ( $raw_old_value !== $default_value && _is_equal_database_value( $raw_old_value, $value ) ) { 791 809 return false; 792 810 } 793 811 794 if ( $ old_value === $default_value ) {812 if ( $raw_old_value === $default_value ) { 795 813 796 814 // Default setting for new options is 'yes'.
Note: See TracChangeset
for help on using the changeset viewer.