WordPress.org

Make WordPress Core

Ticket #14546: 14546.diff

File 14546.diff, 8.5 KB (added by duck_, 2 years ago)
  • wp-includes/taxonomy.php

     
    291291 * @param array|string $args See above description for the two keys values. 
    292292 */ 
    293293function register_taxonomy( $taxonomy, $object_type, $args = array() ) { 
    294         global $wp_taxonomies, $wp_rewrite, $wp; 
     294        global $wp_taxonomies, $wp; 
    295295 
    296296        if ( ! is_array($wp_taxonomies) ) 
    297297                $wp_taxonomies = array(); 
     
    329329                else 
    330330                        $tag = '([^/]+)'; 
    331331 
    332                 $wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); 
    333                 $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); 
     332                add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); 
     333                add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); 
    334334        } 
    335335 
    336336        if ( is_null($args['show_ui']) ) 
  • wp-includes/link-template.php

     
    589589 * @return string Link to the feed for the term specified by $term_id and $taxonomy. 
    590590*/ 
    591591function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) { 
    592         global $wp_rewrite; 
    593  
    594592        $term_id = ( int ) $term_id; 
    595593 
    596594        $term = get_term( $term_id, $taxonomy  ); 
  • wp-includes/category-template.php

     
    612612 * @return string 
    613613 */ 
    614614function wp_generate_tag_cloud( $tags, $args = '' ) { 
    615         global $wp_rewrite; 
    616615        $defaults = array( 
    617616                'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 0, 
    618617                'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC', 
  • wp-includes/post.php

     
    10011001                        $args->rewrite['feeds'] = (bool) $args->has_archive; 
    10021002 
    10031003                if ( $args->hierarchical ) 
    1004                         $wp_rewrite->add_rewrite_tag("%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name="); 
     1004                        add_rewrite_tag("%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name="); 
    10051005                else 
    1006                         $wp_rewrite->add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name="); 
     1006                        add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name="); 
    10071007 
    10081008                if ( $args->has_archive ) { 
    10091009                        $archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive; 
     
    10121012                        else 
    10131013                                $archive_slug = $wp_rewrite->root . $archive_slug; 
    10141014 
    1015                         $wp_rewrite->add_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' ); 
     1015                        add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' ); 
    10161016                        if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) { 
    10171017                                $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')'; 
    1018                                 $wp_rewrite->add_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' ); 
    1019                                 $wp_rewrite->add_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' ); 
     1018                                add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' ); 
     1019                                add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' ); 
    10201020                        } 
    10211021                        if ( $args->rewrite['pages'] ) 
    1022                                 $wp_rewrite->add_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' ); 
     1022                                add_rewrite_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' ); 
    10231023                } 
    10241024 
    1025                 $wp_rewrite->add_permastruct($post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'], $args->permalink_epmask); 
     1025                add_permastruct($post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'], $args->permalink_epmask); 
    10261026        } 
    10271027 
    10281028        if ( $args->register_meta_box_cb ) 
     
    19631963 * @return mixed False on failure 
    19641964 */ 
    19651965function wp_delete_post( $postid = 0, $force_delete = false ) { 
    1966         global $wpdb, $wp_rewrite; 
     1966        global $wpdb; 
    19671967 
    19681968        if ( !$post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) ) 
    19691969                return $post; 
     
    24012401 * 
    24022402 * @since 1.0.0 
    24032403 * @uses $wpdb 
    2404  * @uses $wp_rewrite 
    24052404 * @uses $user_ID 
    24062405 * @uses do_action() Calls 'pre_post_update' on post ID if this is an update. 
    24072406 * @uses do_action() Calls 'edit_post' action on post ID and post data if this is an update. 
     
    24142413 * @return int|WP_Error The value 0 or WP_Error on failure. The post ID on success. 
    24152414 */ 
    24162415function wp_insert_post($postarr, $wp_error = false) { 
    2417         global $wpdb, $wp_rewrite, $user_ID; 
     2416        global $wpdb, $user_ID; 
    24182417 
    24192418        $defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID, 
    24202419                'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 
  • wp-admin/includes/upgrade.php

     
    3535 * @return array Array keys 'url', 'user_id', 'password', 'password_message'. 
    3636 */ 
    3737function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '' ) { 
    38         global $wp_rewrite; 
    39  
    4038        if ( !empty( $deprecated ) ) 
    4139                _deprecated_argument( __FUNCTION__, '2.6' ); 
    4240 
     
    8280 
    8381        wp_install_defaults($user_id); 
    8482 
    85         $wp_rewrite->flush_rules(); 
     83        flush_rewrite_rules(); 
    8684 
    8785        wp_new_blog_notification($blog_title, $guessurl, $user_id, ($email_password ? $user_password : __('The password you chose during the install.') ) ); 
    8886 
     
    391389 * @since 1.0.1 
    392390 */ 
    393391function upgrade_all() { 
    394         global $wp_current_db_version, $wp_db_version, $wp_rewrite; 
     392        global $wp_current_db_version, $wp_db_version; 
    395393        $wp_current_db_version = __get_option('db_version'); 
    396394 
    397395        // We are up-to-date. Nothing to do. 
  • wp-admin/includes/misc.php

     
    200200 * @param unknown_type $value 
    201201 */ 
    202202function update_home_siteurl( $old_value, $value ) { 
    203         global $wp_rewrite; 
    204  
    205203        if ( defined( "WP_INSTALLING" ) ) 
    206204                return; 
    207205 
    208206        // If home changed, write rewrite rules to new location. 
    209         $wp_rewrite->flush_rules(); 
     207        flush_rewrite_rules(); 
    210208} 
    211209 
    212210add_action( 'update_option_home', 'update_home_siteurl', 10, 2 ); 
  • wp-admin/includes/schema.php

     
    811811 *      so the error code must be checked) or failure. 
    812812 */ 
    813813function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false ) { 
    814         global $wpdb, $current_site, $wp_db_version, $wp_rewrite; 
     814        global $wpdb, $current_site, $wp_db_version; 
    815815 
    816816        $errors = new WP_Error(); 
    817817        if ( '' == $domain ) 
     
    932932        else 
    933933                update_option( 'permalink_structure', '/blog/%year%/%monthnum%/%day%/%postname%/'); 
    934934 
    935         $wp_rewrite->flush_rules(); 
     935        flush_rewrite_rules(); 
    936936 
    937937        if ( $subdomain_install ) { 
    938938                $vhost_ok = false; 
  • wp-admin/options-permalink.php

     
    140140else 
    141141        $usingpi = false; 
    142142 
    143 $wp_rewrite->flush_rules(); 
     143flush_rewrite_rules(); 
    144144 
    145145if (isset($_POST['submit'])) : ?> 
    146146<div id="message" class="updated"><p><?php 
  • wp-admin/admin.php

     
    3030require_once(dirname(dirname(__FILE__)) . '/wp-load.php'); 
    3131 
    3232if ( get_option('db_upgraded') ) { 
    33         $wp_rewrite->flush_rules(); 
     33        flush_rewrite_rules(); 
    3434        update_option( 'db_upgraded',  false ); 
    3535 
    3636        /**