• Resolved arhineus

    (@arhineus)


    I’m searching to find where the installation script populates the database with the initial posts and pages, but haven’t had any luck.

    Hoping someone can point me in the right direction.

Viewing 1 replies (of 1 total)
  • It’s wp-admin/install.php

    But if you want to change what the intial script installs, create your own install.php and put it in the wp-content folder and WordPress will use that rather than wp-admin/install.php.

    Here’s an install script that will install only the bare bones data (i.e. the default category)

    <?php
    function wp_install_defaults() {
    	global $wpdb;
    
    	// Default category
    	$cat_name = $wpdb->escape(__('Uncategorized'));
    	$cat_slug = sanitize_title(_c('Uncategorized|Default category slug'));
    	$wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$cat_name', '$cat_slug', '0')");
    	$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('1', 'category', '', '0', '1')");
    }
    ?>
Viewing 1 replies (of 1 total)

The topic ‘Database Population’ is closed to new replies.