Introduce initial_db_version and leverage it so that pointers only get shown to updated installs, not new 3.3 installs. props nacin. see #18693

git-svn-id: http://svn.automattic.com/wordpress/trunk@19410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2011-11-22 21:50:50 +00:00
parent 91746f3179
commit a1fb35ca98
3 changed files with 18 additions and 2 deletions

View File

@ -330,7 +330,7 @@ $wp_queries = wp_get_db_schema( 'all' );
* @uses $wp_db_version
*/
function populate_options() {
global $wpdb, $wp_db_version, $current_site;
global $wpdb, $wp_db_version, $current_site, $wp_db_current_db_version;
$guessurl = wp_guess_url();
@ -480,6 +480,12 @@ function populate_options() {
'default_post_format' => 0,
);
// 3.3
if ( ! is_multisite() ) {
$options['initial_db_version'] = ! empty( $wp_db_current_db_version ) && $wp_current_db_version < $wp_db_version
? $wp_current_db_version : $wp_db_version;
}
// 3.0 multisite
if ( is_multisite() ) {
/* translators: blog tagline */
@ -886,7 +892,8 @@ We hope you enjoy your new site. Thanks!
'add_new_users' => '0',
'upload_space_check_disabled' => '0',
'subdomain_install' => intval( $subdomain_install ),
'global_terms_enabled' => global_terms_enabled() ? '1' : '0'
'global_terms_enabled' => global_terms_enabled() ? '1' : '0',
'initial_db_version' => get_option( 'initial_db_version' ),
);
if ( ! $subdomain_install )
$sitemeta['illegal_names'][] = 'blog';

View File

@ -1677,10 +1677,14 @@ final class WP_Internal_Pointers {
* remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp330_toolbar' ) );
*/
public static function enqueue_scripts( $hook_suffix ) {
if ( get_site_option( 'initial_db_version' ) >= 19389 ) // Final db_version for 3.3.
return;
/*
* Register feature pointers
* Format: array( hook_suffix => pointer_id )
*/
$registered_pointers = array(
'index.php' => 'wp330_toolbar',
'post-new.php' => 'wp330_media_uploader',

View File

@ -1151,6 +1151,11 @@ function upgrade_330() {
&& is_main_site() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) )
delete_metadata( 'user', 0, 'dismissed_wp_pointers', '', true );
if ( $wp_current_db_version < 19390 && is_main_site() ) {
update_site_option( 'initial_db_version', $wp_current_db_version );
// populate_options() will handle single-site.
}
if ( $wp_current_db_version >= 11548 )
return;