Changeset 43571 for trunk/src/wp-admin/includes/upgrade.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/upgrade.php
r43243 r43571 148 148 if ( $cat_id == null ) { 149 149 $wpdb->insert( 150 $wpdb->sitecategories, array( 150 $wpdb->sitecategories, 151 array( 151 152 'cat_ID' => 0, 152 153 'cat_name' => $cat_name, … … 163 164 164 165 $wpdb->insert( 165 $wpdb->terms, array( 166 $wpdb->terms, 167 array( 166 168 'term_id' => $cat_id, 167 169 'name' => $cat_name, … … 171 173 ); 172 174 $wpdb->insert( 173 $wpdb->term_taxonomy, array( 175 $wpdb->term_taxonomy, 176 array( 174 177 'term_id' => $cat_id, 175 178 'taxonomy' => 'category', … … 207 210 208 211 $wpdb->insert( 209 $wpdb->posts, array( 212 $wpdb->posts, 213 array( 210 214 'post_author' => $user_id, 211 215 'post_date' => $now, … … 226 230 ); 227 231 $wpdb->insert( 228 $wpdb->term_relationships, array( 232 $wpdb->term_relationships, 233 array( 229 234 'term_taxonomy_id' => $cat_tt_id, 230 235 'object_id' => 1, … … 249 254 ); 250 255 $wpdb->insert( 251 $wpdb->comments, array( 256 $wpdb->comments, 257 array( 252 258 'comment_post_ID' => 1, 253 259 'comment_author' => $first_comment_author, … … 276 282 277 283 As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to delete this page and create new pages for your content. Have fun!" 278 ), admin_url() 284 ), 285 admin_url() 279 286 ); 280 287 281 288 $first_post_guid = get_option( 'home' ) . '/?page_id=2'; 282 289 $wpdb->insert( 283 $wpdb->posts, array( 290 $wpdb->posts, 291 array( 284 292 'post_author' => $user_id, 285 293 'post_date' => $now, … … 301 309 ); 302 310 $wpdb->insert( 303 $wpdb->postmeta, array( 311 $wpdb->postmeta, 312 array( 304 313 'post_id' => 2, 305 314 'meta_key' => '_wp_page_template', … … 324 333 325 334 $wpdb->insert( 326 $wpdb->posts, array( 335 $wpdb->posts, 336 array( 327 337 'post_author' => $user_id, 328 338 'post_date' => $now, … … 345 355 ); 346 356 $wpdb->insert( 347 $wpdb->postmeta, array( 357 $wpdb->postmeta, 358 array( 348 359 'post_id' => 3, 349 360 'meta_key' => '_wp_page_template', … … 356 367 // Set up default widgets for default theme. 357 368 update_option( 358 'widget_search', array( 369 'widget_search', 370 array( 359 371 2 => array( 'title' => '' ), 360 372 '_multiwidget' => 1, … … 362 374 ); 363 375 update_option( 364 'widget_recent-posts', array( 376 'widget_recent-posts', 377 array( 365 378 2 => array( 366 379 'title' => '', … … 371 384 ); 372 385 update_option( 373 'widget_recent-comments', array( 386 'widget_recent-comments', 387 array( 374 388 2 => array( 375 389 'title' => '', … … 380 394 ); 381 395 update_option( 382 'widget_archives', array( 396 'widget_archives', 397 array( 383 398 2 => array( 384 399 'title' => '', … … 390 405 ); 391 406 update_option( 392 'widget_categories', array( 407 'widget_categories', 408 array( 393 409 2 => array( 394 410 'title' => '', … … 401 417 ); 402 418 update_option( 403 'widget_meta', array( 419 'widget_meta', 420 array( 404 421 2 => array( 'title' => '' ), 405 422 '_multiwidget' => 1, … … 407 424 ); 408 425 update_option( 409 'sidebars_widgets', array( 426 'sidebars_widgets', 427 array( 410 428 'wp_inactive_widgets' => array(), 411 429 'sidebar-1' => array( … … 443 461 if ( ! is_super_admin( $user_id ) && $user_id != 1 ) { 444 462 $wpdb->delete( 445 $wpdb->usermeta, array( 463 $wpdb->usermeta, 464 array( 446 465 'user_id' => $user_id, 447 466 'meta_key' => $wpdb->base_prefix . '1_capabilities', … … 565 584 https://wordpress.org/ 566 585 ' 567 ), $blog_url, $name, $password, $login_url 586 ), 587 $blog_url, 588 $name, 589 $password, 590 $login_url 568 591 ); 569 592 … … 833 856 if ( ! $cat && 0 != $post->post_category ) { // If there's no result 834 857 $wpdb->insert( 835 $wpdb->post2cat, array( 858 $wpdb->post2cat, 859 array( 836 860 'post_id' => $post->ID, 837 861 'category_id' => $post->post_category, … … 1117 1141 foreach ( $objects as $object ) { 1118 1142 $wpdb->update( 1119 $wpdb->posts, array( 1143 $wpdb->posts, 1144 array( 1120 1145 'post_status' => 'attachment', 1121 1146 'post_mime_type' => $object->post_type, … … 1235 1260 $wpdb->prepare( 1236 1261 "INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES 1237 (%d, %s, %s, %d)", $term_id, $name, $slug, $term_group 1262 (%d, %s, %s, %d)", 1263 $term_id, 1264 $name, 1265 $slug, 1266 $term_group 1238 1267 ) 1239 1268 ); … … 1289 1318 1290 1319 $wpdb->insert( 1291 $wpdb->term_relationships, array( 1320 $wpdb->term_relationships, 1321 array( 1292 1322 'object_id' => $post_id, 1293 1323 'term_taxonomy_id' => $tt_id, … … 1328 1358 1329 1359 $wpdb->insert( 1330 $wpdb->term_taxonomy, array( 1360 $wpdb->term_taxonomy, 1361 array( 1331 1362 'term_id' => $term_id, 1332 1363 'taxonomy' => 'link_category', … … 1356 1387 1357 1388 $wpdb->insert( 1358 $wpdb->term_relationships, array( 1389 $wpdb->term_relationships, 1390 array( 1359 1391 'object_id' => $link->link_id, 1360 1392 'term_taxonomy_id' => $tt_id, … … 1377 1409 } 1378 1410 $wpdb->insert( 1379 $wpdb->term_relationships, array( 1411 $wpdb->term_relationships, 1412 array( 1380 1413 'object_id' => $link_id, 1381 1414 'term_taxonomy_id' => $tt_id,
Note: See TracChangeset
for help on using the changeset viewer.