Exemplo n.º 1
0
/**
 * Activates the Ribcage plugin.
 * Adds Ribcage tables to the database and options to wp_options with defaults installed.
 *
 * @author Alex Andrews <*****@*****.**>
 * @return void
 * @todo When uninstall and deactive routines are added convert into a class as per http://wordpress.stackexchange.com/questions/25910/uninstall-activate-deactivate-a-plugin-typical-features-how-to/25979#25979
 */
function ribcage_activate()
{
    require_once dirname(__FILE__) . '/ribcage-includes/install.php';
    if (!get_option('ribcage_database_version') || get_option('ribcage_database_version') != '1.1') {
        ribcage_create_tables();
        update_option("ribcage_database_version", "1.1");
    }
    // Flush rewrite rules
    ribcage_flush_rules();
}
Exemplo n.º 2
0
function ribcage_activate()
{
    global $wpdb, $table_prefix;
    $version = get_option("ribcage_db_version");
    if ($version != 1) {
        // Upgrade function changed in WordPress 2.3
        if (version_compare($wp_version, '2.3-beta', '>=')) {
            require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        } else {
            require_once ABSPATH . 'wp-admin/upgrade-functions.php';
        }
        require_once dirname(__FILE__) . '/ribcage-includes/install.php';
        dbDelta($ribcage_schema);
        update_option('ribcage_db_version', 1);
        add_option('ribcage_ebay_email');
    }
    ribcage_flush_rules();
}