WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10720 closed defect (bug) (invalid)

pre_option_gmt_offset is never applied

Reported by: johnjosephbachir Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8.4
Component: General Keywords:
Focuses: Cc:

Description

There is function added to the call stack for pre_option_gmt_offset, but the filter is never applied.

in default-filters.php, line 210 (the very end of the file:

<?
add_filter('pre_option_gmt_offset','wp_timezone_override_offset');
?>

But pre_option_gmt_offset is never applied (a full-project search for that string only finds the above occurrence).

It's also the same situation with update_option_start_of_week and update_option_gmt_offset in general-template.php, line 1166

<?
add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' );
add_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' );
?>

(line 1168 is actually identical to 1166 -- see #10718)

It seems like there must have been a code refactoring regarding the time settings, and these hooks either got renamed or removed?

Change History (3)

comment:1 @westi6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

These filters and actions are run.

The are run by the calls in get_option():

	// Allow plugins to short-circuit options.
	$pre = apply_filters( 'pre_option_' . $setting, false );

And update_option():

	if ( $wpdb->rows_affected == 1 ) {
		do_action( "update_option_{$option_name}", $oldvalue, $_newvalue );
		return true;
	}

comment:2 @westi6 years ago

  • Milestone 2.8.5 deleted

comment:3 @johnjosephbachir6 years ago

Ohhh, meta programming. Excellent :)

Note: See TracTickets for help on using tickets.