Changeset 21500
- Timestamp:
- 08/13/2012 03:55:15 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/upgrade.php
r21413 r21500 123 123 $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => $cat_id, 'taxonomy' => 'category', 'description' => '', 'parent' => 0, 'count' => 1)); 124 124 $cat_tt_id = $wpdb->insert_id; 125 126 // Default link category127 $cat_name = __('Blogroll');128 /* translators: Default link category slug */129 $cat_slug = sanitize_title(_x('Blogroll', 'Default link category slug'));130 131 if ( global_terms_enabled() ) {132 $blogroll_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );133 if ( $blogroll_id == null ) {134 $wpdb->insert( $wpdb->sitecategories, array('cat_ID' => 0, 'cat_name' => $cat_name, 'category_nicename' => $cat_slug, 'last_updated' => current_time('mysql', true)) );135 $blogroll_id = $wpdb->insert_id;136 }137 update_option('default_link_category', $blogroll_id);138 } else {139 $blogroll_id = 2;140 }141 142 $wpdb->insert( $wpdb->terms, array('term_id' => $blogroll_id, 'name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) );143 $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => $blogroll_id, 'taxonomy' => 'link_category', 'description' => '', 'parent' => 0, 'count' => 7));144 $blogroll_tt_id = $wpdb->insert_id;145 146 // Now drop in some default links147 $default_links = array();148 $default_links[] = array( 'link_url' => __( 'http://codex.wordpress.org/' ),149 'link_name' => __( 'Documentation' ),150 'link_rss' => '',151 'link_notes' => '');152 153 $default_links[] = array( 'link_url' => __( 'http://wordpress.org/news/' ),154 'link_name' => __( 'WordPress Blog' ),155 'link_rss' => __( 'http://wordpress.org/news/feed/' ),156 'link_notes' => '');157 158 $default_links[] = array( 'link_url' => __( 'http://wordpress.org/support/' ),159 'link_name' => _x( 'Support Forums', 'default link' ),160 'link_rss' => '',161 'link_notes' =>'');162 163 $default_links[] = array( 'link_url' => 'http://wordpress.org/extend/plugins/',164 'link_name' => _x( 'Plugins', 'Default link to wordpress.org/extend/plugins/' ),165 'link_rss' => '',166 'link_notes' =>'');167 168 $default_links[] = array( 'link_url' => 'http://wordpress.org/extend/themes/',169 'link_name' => _x( 'Themes', 'Default link to wordpress.org/extend/themes/' ),170 'link_rss' => '',171 'link_notes' =>'');172 173 $default_links[] = array( 'link_url' => __( 'http://wordpress.org/support/forum/requests-and-feedback' ),174 'link_name' => __( 'Feedback' ),175 'link_rss' => '',176 'link_notes' =>'');177 178 $default_links[] = array( 'link_url' => __( 'http://planet.wordpress.org/' ),179 'link_name' => __( 'WordPress Planet' ),180 'link_rss' => '',181 'link_notes' =>'');182 183 foreach ( $default_links as $link ) {184 $wpdb->insert( $wpdb->links, $link);185 $wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => $blogroll_tt_id, 'object_id' => $wpdb->insert_id) );186 }187 125 188 126 // First post
Note: See TracChangeset
for help on using the changeset viewer.