Changeset 4412
- Timestamp:
- 11/24/2016 04:15:39 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r4406 r4412 62 62 // Load the API routes. 63 63 add_action( 'rest_api_init', array( __NAMESPACE__ . '\API\Base', 'load_routes' ) ); 64 65 // Work around caching issues 66 add_filter( 'pre_option_jetpack_sync_full__started' , array( $this, 'bypass_options_cache' ), 10, 2 ); 67 add_filter( 'pre_option_jetpack_sync_full__params' , array( $this, 'bypass_options_cache' ), 10, 2 ); 68 add_filter( 'pre_option_jetpack_sync_full__queue_finished' , array( $this, 'bypass_options_cache' ), 10, 2 ); 69 add_filter( 'pre_option_jetpack_sync_full__send_started' , array( $this, 'bypass_options_cache' ), 10, 2 ); 70 add_filter( 'pre_option_jetpack_sync_full__finished' , array( $this, 'bypass_options_cache' ), 10, 2 ); 64 71 65 72 /* … … 633 640 $wp_query->query_vars['meta_key'] = '_active_installs'; 634 641 } 642 } 643 644 /** 645 * Filter to bypass caching for options critical to Jetpack sync to work around race conditions and other unidentified bugs. 646 * If this works and becomes a permanent solution, it probably belongs elsewhere. 647 */ 648 public function bypass_options_cache( $value, $option ) { 649 global $wpdb; 650 $value = $wpdb->get_var( 651 $wpdb->prepare( 652 "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", 653 $option 654 ) 655 ); 656 $value = maybe_unserialize( $value ); 657 658 return $value; 635 659 } 636 660
Note: See TracChangeset
for help on using the changeset viewer.