pre_schema_upgrade [ WordPress Function ]
pre_schema_upgrade ( No parameters )
| Defined at: |
|
Soorgelijke functies: wp_upgrade, do_core_upgrade, get_theme_updates, wp_max_upload_size, wp_get_schedule
Runs before the schema is upgraded.
Source
<?php
function pre_schema_upgrade() {
global $wp_current_db_version, $wp_db_version, $wpdb;
// Upgrade versions prior to 2.9
if ( $wp_current_db_version < 11557 ) {
// Delete duplicate options. Keep the option with the highest option_id.
$wpdb->query("DELETE o1 FROM $wpdb->options AS o1 JOIN $wpdb->options AS o2 USING (`option_name`) WHERE o2.option_id > o1.option_id");
// Drop the old primary key and add the new.
$wpdb->query("ALTER TABLE $wpdb->options DROP PRIMARY KEY, ADD PRIMARY KEY(option_id)");
// Drop the old option_name index. dbDelta() doesn't do the drop.
$wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_name");
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Docs for page upgrade.php
void maybe_disable_automattic_widgets (). pre_schema_upgrade (line 1980). Runs before the schema is upgraded. since: 2.9.0. void pre_schema_upgrade () ...
phpdoc.wordpress.org - #10994 (2.8.5 Multiple primary key Error) – WordPress Trac
Oct 21, 2009 ... After a little more digging, I figured out that some of the indices are handled by function pre_schema_upgrade(), and the code in there does not ...
core.trac.wordpress.org - PHPXRef 0.7 : WordPress : Detail view of upgrade.php
maybe_disable_automattic_widgets() pre_schema_upgrade() ...
phpxref.ftwr.co.uk - wp_upgrade (WordPress Function) - WPSeek.com
pre_schema_upgrade(); make_db_current_silent(); upgrade_all(); if ( is_multisite () && is_main_site() ) upgrade_network(); wp_cache_flush(); if ( is_multisite() ) { ...
wpseek.com