- // Default link category
- $cat_name = __('Blogroll');
- /* translators: Default link category slug */
- $cat_slug = sanitize_title(_x('Blogroll', 'Default link category slug'));
-
- if ( global_terms_enabled() ) {
- $blogroll_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
- if ( $blogroll_id == null ) {
- $wpdb->insert( $wpdb->sitecategories, array('cat_ID' => 0, 'cat_name' => $cat_name, 'category_nicename' => $cat_slug, 'last_updated' => current_time('mysql', true)) );
- $blogroll_id = $wpdb->insert_id;
- }
- update_option('default_link_category', $blogroll_id);
- } else {
- $blogroll_id = 2;
- }
-
- $wpdb->insert( $wpdb->terms, array('term_id' => $blogroll_id, 'name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) );
- $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => $blogroll_id, 'taxonomy' => 'link_category', 'description' => '', 'parent' => 0, 'count' => 7));
- $blogroll_tt_id = $wpdb->insert_id;
-
- // Now drop in some default links
- $default_links = array();
- $default_links[] = array( 'link_url' => 'http://codex.wordpress.org/',
- 'link_name' => 'Documentation',
- 'link_rss' => '',
- 'link_notes' => '');
-
- $default_links[] = array( 'link_url' => 'http://wordpress.org/news/',
- 'link_name' => 'WordPress Blog',
- 'link_rss' => 'http://wordpress.org/news/feed/',
- 'link_notes' => '');
-
- $default_links[] = array( 'link_url' => 'http://wordpress.org/extend/ideas/',
- 'link_name' => 'Suggest Ideas',
- 'link_rss' => '',
- 'link_notes' =>'');
-
- $default_links[] = array( 'link_url' => 'http://wordpress.org/support/',
- 'link_name' => 'Support Forum',
- 'link_rss' => '',
- 'link_notes' =>'');
-
- $default_links[] = array( 'link_url' => 'http://wordpress.org/extend/plugins/',
- 'link_name' => 'Plugins',
- 'link_rss' => '',
- 'link_notes' =>'');
-
- $default_links[] = array( 'link_url' => 'http://wordpress.org/extend/themes/',
- 'link_name' => 'Themes',
- 'link_rss' => '',
- 'link_notes' =>'');
-
- $default_links[] = array( 'link_url' => 'http://planet.wordpress.org/',
- 'link_name' => 'WordPress Planet',
- 'link_rss' => '',
- 'link_notes' =>'');
-
- foreach ( $default_links as $link ) {
- $wpdb->insert( $wpdb->links, $link);
- $wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => $blogroll_tt_id, 'object_id' => $wpdb->insert_id) );
- }
-