<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[19389] trunk: Remove old dismissed pointers as the IDs have changed.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/19389">19389</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2011-11-21 23:04:35 +0000 (Mon, 21 Nov 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove old dismissed pointers as the IDs have changed. Switch to underscores that way we don't need to translate them for method names. Avoid an empty pointer in the array. see <a href="http://core.trac.wordpress.org/ticket/18693">#18693</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpincludesversionphp">trunk/wp-includes/version.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (19388 => 19389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2011-11-21 22:39:48 UTC (rev 19388)
+++ trunk/wp-admin/admin-ajax.php        2011-11-21 23:04:35 UTC (rev 19389)
</span><span class="lines">@@ -1575,7 +1575,7 @@
</span><span class="cx"> 
</span><span class="cx"> //        check_ajax_referer( 'dismiss-pointer_' . $pointer );
</span><span class="cx"> 
</span><del>-        $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
</del><ins>+        $dismissed = array_filter( explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ) );
</ins><span class="cx"> 
</span><span class="cx">         if ( in_array( $pointer, $dismissed ) )
</span><span class="cx">                 die( '0' );
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (19388 => 19389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2011-11-21 22:39:48 UTC (rev 19388)
+++ trunk/wp-admin/includes/template.php        2011-11-21 23:04:35 UTC (rev 19389)
</span><span class="lines">@@ -1673,7 +1673,7 @@
</span><span class="cx">          * All pointers can be disabled using the following:
</span><span class="cx">          *     remove_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );
</span><span class="cx">          *
</span><del>-         * Individual pointers (e.g. wp330-toolbar) can be disabled using the following:
</del><ins>+         * Individual pointers (e.g. wp330_toolbar) can be disabled using the following:
</ins><span class="cx">          *     remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp330_toolbar' ) );
</span><span class="cx">          */
</span><span class="cx">         public static function enqueue_scripts( $hook_suffix ) {
</span><span class="lines">@@ -1682,9 +1682,10 @@
</span><span class="cx">                  * Format: array( hook_suffix =&gt; pointer_id )
</span><span class="cx">                  */
</span><span class="cx">                 $registered_pointers = array(
</span><del>-                        'index.php'    =&gt; 'wp330-toolbar',
-                        'post-new.php' =&gt; 'wp330-media-uploader',
-                        'themes.php'   =&gt; 'wp330-saving-widgets',
</del><ins>+                        'index.php'    =&gt; 'wp330_toolbar',
+                        'post-new.php' =&gt; 'wp330_media_uploader',
+                        'post.php'     =&gt; 'wp330_media_uploader',
+                        'themes.php'   =&gt; 'wp330_saving_widgets',
</ins><span class="cx">                 );
</span><span class="cx"> 
</span><span class="cx">                 // Check if screen related pointer is registered
</span><span class="lines">@@ -1701,7 +1702,7 @@
</span><span class="cx">                         return;
</span><span class="cx"> 
</span><span class="cx">                 // Bind pointer print function
</span><del>-                add_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . str_replace( '-', '_', $pointer ) ) );
</del><ins>+                add_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . $pointer ) );
</ins><span class="cx"> 
</span><span class="cx">                 // Add pointers script and style to queue
</span><span class="cx">                 wp_enqueue_style( 'wp-pointer' );
</span><span class="lines">@@ -1753,7 +1754,7 @@
</span><span class="cx">                 if ( is_multisite() &amp;&amp; is_super_admin() )
</span><span class="cx">                         $content .= '&lt;p&gt;' .esc_js( __( 'Network Admin is now located in the My Sites menu.' ) ) . '&lt;/p&gt;';
</span><span class="cx"> 
</span><del>-                WP_Internal_Pointers::print_js( 'wp330-toolbar', '#wpadminbar', array(
</del><ins>+                WP_Internal_Pointers::print_js( 'wp330_toolbar', '#wpadminbar', array(
</ins><span class="cx">                         'content'  =&gt; $content,
</span><span class="cx">                         'position' =&gt; array( 'edge' =&gt; 'top', 'align' =&gt; 'center' ),
</span><span class="cx">                 ) );
</span><span class="lines">@@ -1768,7 +1769,7 @@
</span><span class="cx">                 $content  = '&lt;h3&gt;' . esc_js( __( 'Updated Media Uploader' ) ) . '&lt;/h3&gt;';
</span><span class="cx">                 $content .= '&lt;p&gt;' . esc_js( __( 'The single media icon now launches the uploader for all file types, and the new drag and drop interface makes uploading a breeze.' ) ) . '&lt;/p&gt;';
</span><span class="cx"> 
</span><del>-                WP_Internal_Pointers::print_js( 'wp330-media-uploader', '#content-add_media', array(
</del><ins>+                WP_Internal_Pointers::print_js( 'wp330_media_uploader', '#content-add_media', array(
</ins><span class="cx">                         'content'  =&gt; $content,
</span><span class="cx">                         'position' =&gt; array( 'edge' =&gt; 'left', 'align' =&gt; 'center' ),
</span><span class="cx">                 ) );
</span><span class="lines">@@ -1783,7 +1784,7 @@
</span><span class="cx">                 $content  = '&lt;h3&gt;' . esc_js( __( 'New Feature: Saving Widgets' ) ) . '&lt;/h3&gt;';
</span><span class="cx">                 $content .= '&lt;p&gt;' . esc_js( __( 'If you change your mind and revert to your previous theme, we&amp;#8217;ll put the widgets back the way you had them.' ) ) . '&lt;/p&gt;';
</span><span class="cx"> 
</span><del>-                WP_Internal_Pointers::print_js( 'wp330-saving-widgets', '#message2', array(
</del><ins>+                WP_Internal_Pointers::print_js( 'wp330_saving_widgets', '#message2', array(
</ins><span class="cx">                         'content'  =&gt; $content,
</span><span class="cx">                         'position' =&gt; array( 'edge' =&gt; 'top', 'align' =&gt; 'left' ),
</span><span class="cx">                 ) );
</span></span></pre></div>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (19388 => 19389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2011-11-21 22:39:48 UTC (rev 19388)
+++ trunk/wp-admin/includes/upgrade.php        2011-11-21 23:04:35 UTC (rev 19389)
</span><span class="lines">@@ -451,7 +451,7 @@
</span><span class="cx">         if ( $wp_current_db_version &lt; 15260 )
</span><span class="cx">                 upgrade_300();
</span><span class="cx"> 
</span><del>-        if ( $wp_current_db_version &lt; 19061 )
</del><ins>+        if ( $wp_current_db_version &lt; 19389 )
</ins><span class="cx">                 upgrade_330();
</span><span class="cx"> 
</span><span class="cx">         maybe_disable_automattic_widgets();
</span><span class="lines">@@ -1146,6 +1146,12 @@
</span><span class="cx">                 $wpdb-&gt;query( &quot;DELETE FROM $wpdb-&gt;usermeta WHERE meta_key IN ('show_admin_bar_admin', 'plugins_last_view')&quot; );
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        // 3.3-beta. Can remove before release.
+        if ( $wp_current_db_version &gt; 18715 &amp;&amp; $wp_current_db_version &lt; 19389
+                &amp;&amp; is_main_site() &amp;&amp; ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) )
+                        delete_metadata( 'user', 0, 'dismissed_wp_pointers', '', true );
+
+
</ins><span class="cx">         if ( $wp_current_db_version &gt;= 11548 )
</span><span class="cx">                 return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesversionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/version.php (19388 => 19389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2011-11-21 22:39:48 UTC (rev 19388)
+++ trunk/wp-includes/version.php        2011-11-21 23:04:35 UTC (rev 19389)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx">  *
</span><span class="cx">  * @global int $wp_db_version
</span><span class="cx">  */
</span><del>-$wp_db_version = 19364;
</del><ins>+$wp_db_version = 19389;
</ins><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * Holds the TinyMCE version
</span></span></pre>
</div>
</div>

</body>
</html>