Ticket #41699: 41699.2.diff
| File 41699.2.diff, 9.6 KB (added by , 8 years ago) |
|---|
-
src/wp-includes/default-filters.php
add_action( 'sanitize_comment_cookies', 305 305 add_action( 'admin_print_scripts', 'print_emoji_detection_script' ); 306 306 add_action( 'admin_print_scripts', 'print_head_scripts', 20 ); 307 307 add_action( 'admin_print_footer_scripts', '_wp_footer_scripts' ); 308 308 add_action( 'admin_print_styles', 'print_emoji_styles' ); 309 309 add_action( 'admin_print_styles', 'print_admin_styles', 20 ); 310 310 add_action( 'init', 'smilies_init', 5 ); 311 311 add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); 312 312 add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 ); 313 313 add_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); 314 314 // Create a revision whenever a post is updated. 315 315 add_action( 'post_updated', 'wp_save_post_revision', 10, 1 ); 316 316 add_action( 'publish_post', '_publish_post_hook', 5, 1 ); 317 317 add_action( 'transition_post_status', '_transition_post_status', 5, 3 ); 318 318 add_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 ); 319 319 add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); 320 add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); 321 add_action( 'welcome_panel', 'wp_welcome_panel' ); 322 323 // Cron tasks 320 324 add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' ); 321 325 add_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts' ); 322 add_action( 'admin_init', 'send_frame_options_header', 10, 0 );323 326 add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' ); 324 327 add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment' ); 325 add_action( ' welcome_panel', 'wp_welcome_panel');328 add_action( 'delete_expired_transients', 'delete_expired_transients' ); 326 329 327 330 // Navigation menu actions 328 331 add_action( 'delete_post', '_wp_delete_post_menu_item' ); 329 332 add_action( 'delete_term', '_wp_delete_tax_menu_item', 10, 3 ); 330 333 add_action( 'transition_post_status', '_wp_auto_add_pages_to_menu', 10, 3 ); 331 334 add_action( 'delete_post', '_wp_delete_customize_changeset_dependent_auto_drafts' ); 332 335 333 336 // Post Thumbnail CSS class filtering 334 337 add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' ); 335 338 add_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' ); 336 339 337 340 // Redirect Old Slugs 338 341 add_action( 'template_redirect', 'wp_old_slug_redirect' ); 339 342 add_action( 'post_updated', 'wp_check_for_changed_slugs', 12, 3 ); 340 343 add_action( 'attachment_updated', 'wp_check_for_changed_slugs', 12, 3 ); -
src/wp-includes/option.php
function set_transient( $transient, $val 785 785 * Fires after the value for a transient has been set. 786 786 * 787 787 * @since 3.0.0 788 788 * @since 3.6.0 The `$value` and `$expiration` parameters were added. 789 789 * 790 790 * @param string $transient The name of the transient. 791 791 * @param mixed $value Transient value. 792 792 * @param int $expiration Time until expiration in seconds. 793 793 */ 794 794 do_action( 'setted_transient', $transient, $value, $expiration ); 795 795 } 796 796 return $result; 797 797 } 798 798 799 799 /** 800 * Deletes all expired transients. 801 * 802 * The multi-table delete syntax is used to delete the transient record 803 * from table a, and the corresponding transient_timeout record from table b. + 804 * 805 * @since 4.9.0 806 */ 807 function delete_expired_transients() { 808 global $wpdb; 809 810 $time = time(); 811 812 $sql = "DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b 813 WHERE a.option_name LIKE %s 814 AND a.option_name NOT LIKE %s 815 AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) ) 816 AND b.option_value < %d"; 817 818 $wpdb->query( $wpdb->prepare( 819 $sql, 820 $wpdb->esc_like( '_transient_' ) . '%', 821 $wpdb->esc_like( '_transient_timeout_' ) . '%', 822 $time 823 ) ); 824 825 if ( is_main_site() && is_main_network() ) { 826 $sql = "DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b 827 WHERE a.option_name LIKE %s 828 AND a.option_name NOT LIKE %s 829 AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) ) 830 AND b.option_value < %d"; 831 832 $wpdb->query( $wpdb->prepare( 833 $sql, 834 $wpdb->esc_like( '_site_transient_' ) . '%', 835 $wpdb->esc_like( '_site_transient_timeout_' ) . '%', 836 $time 837 ) ); 838 } 839 } 840 841 /** 800 842 * Saves and restores user interface settings stored in a cookie. 801 843 * 802 844 * Checks if the current user-settings cookie is updated and stores it. When no 803 845 * cookie exists (different browser used), adds the last saved cookie restoring 804 846 * the settings. 805 847 * 806 848 * @since 2.7.0 807 849 */ 808 850 function wp_user_settings() { 809 851 810 852 if ( ! is_admin() || wp_doing_ajax() ) { 811 853 return; 812 854 } 813 855 814 856 if ( ! $user_id = get_current_user_id() ) { -
src/wp-admin/admin.php
if ( get_option('db_upgraded') ) { 74 74 /** This action is documented in wp-admin/network/upgrade.php */ 75 75 do_action( 'after_mu_upgrade', $response ); 76 76 unset($response); 77 77 } 78 78 unset($c); 79 79 } 80 80 } 81 81 82 82 require_once(ABSPATH . 'wp-admin/includes/admin.php'); 83 83 84 84 auth_redirect(); 85 85 86 86 // Schedule trash collection 87 87 if ( ! wp_next_scheduled( 'wp_scheduled_delete' ) && ! wp_installing() ) 88 88 wp_schedule_event(time(), 'daily', 'wp_scheduled_delete'); 89 // Schedule Transient cleanup 90 if ( ! wp_next_scheduled( 'delete_expired_transients' ) && ! wp_installing() ) 91 wp_schedule_event( time(), 'daily', 'delete_expired_transients' ); 89 92 90 93 set_screen_options(); 91 94 92 95 $date_format = __( 'F j, Y' ); 93 96 $time_format = __( 'g:i a' ); 94 97 95 98 wp_enqueue_script( 'common' ); 96 99 97 98 99 100 100 /** 101 101 * $pagenow is set in vars.php 102 102 * $wp_importers is sometimes set in wp-admin/includes/import.php 103 103 * The remaining variables are imported as globals elsewhere, declared as globals here 104 104 * 105 105 * @global string $pagenow 106 106 * @global array $wp_importers 107 107 * @global string $hook_suffix 108 108 * @global string $plugin_page 109 109 * @global string $typenow 110 110 * @global string $taxnow 111 111 */ 112 112 global $pagenow, $wp_importers, $hook_suffix, $plugin_page, $typenow, $taxnow; 113 113 114 114 $page_hook = null; -
src/wp-admin/includes/schema.php
function populate_options() { 572 572 'links_recently_updated_time', 'links_recently_updated_prepend', 'links_recently_updated_append', 573 573 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 574 574 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', 575 575 '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 576 576 'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 577 577 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page', 578 578 'wporg_popular_tags', 'what_to_show', 'rss_language', 'language', 'enable_xmlrpc', 'enable_app', 579 579 'embed_autourls', 'default_post_edit_rows', 'gzipcompression', 'advanced_edit' 580 580 ); 581 581 foreach ( $unusedoptions as $option ) 582 582 delete_option($option); 583 583 584 584 // Delete obsolete magpie stuff. 585 585 $wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'"); 586 586 587 /* 588 * Deletes all expired transients. The multi-table delete syntax is used 589 * to delete the transient record from table a, and the corresponding 590 * transient_timeout record from table b. 591 */ 592 $time = time(); 593 $sql = "DELETE a, b FROM $wpdb->options a, $wpdb->options b 594 WHERE a.option_name LIKE %s 595 AND a.option_name NOT LIKE %s 596 AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) ) 597 AND b.option_value < %d"; 598 $wpdb->query( $wpdb->prepare( $sql, $wpdb->esc_like( '_transient_' ) . '%', $wpdb->esc_like( '_transient_timeout_' ) . '%', $time ) ); 599 600 if ( is_main_site() && is_main_network() ) { 601 $sql = "DELETE a, b FROM $wpdb->options a, $wpdb->options b 602 WHERE a.option_name LIKE %s 603 AND a.option_name NOT LIKE %s 604 AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) ) 605 AND b.option_value < %d"; 606 $wpdb->query( $wpdb->prepare( $sql, $wpdb->esc_like( '_site_transient_' ) . '%', $wpdb->esc_like( '_site_transient_timeout_' ) . '%', $time ) ); 607 } 587 delete_expired_transients(); 608 588 } 609 589 610 590 /** 611 591 * Execute WordPress role creation for the various WordPress versions. 612 592 * 613 593 * @since 2.0.0 614 594 */ 615 595 function populate_roles() { 616 596 populate_roles_160(); 617 597 populate_roles_210(); 618 598 populate_roles_230(); 619 599 populate_roles_250(); 620 600 populate_roles_260(); 621 601 populate_roles_270(); 622 602 populate_roles_280();