Ticket #21368: 21368.13.nopointers.diff

File 21368.13.nopointers.diff, 15.3 KB (added by lessbloat, 8 months ago)
Line 
1Index: wp-includes/default-filters.php
2===================================================================
3--- wp-includes/default-filters.php     (revision 22011)
4+++ wp-includes/default-filters.php     (working copy)
5@@ -287,4 +287,7 @@
6 // Automatically embed URLs
7 add_filter( 'default_option_autoembed_urls', '__return_true' );
8 
9+// Welcome Panel
10+add_action( 'welcome_panel', 'wp_welcome_panel' );
11+
12 unset($filter, $action);
13Index: wp-admin/includes/dashboard.php
14===================================================================
15--- wp-admin/includes/dashboard.php     (revision 22011)
16+++ wp-admin/includes/dashboard.php     (working copy)
17@@ -1231,93 +1231,45 @@
18  *
19  * @since 3.3.0
20  */
21-function wp_welcome_panel() {
22-       global $wp_version;
23-
24-       if ( ! current_user_can( 'edit_theme_options' ) )
25-               return;
26-
27-       $classes = 'welcome-panel';
28-
29-       $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
30-       // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
31-       $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
32-       if ( $hide )
33-               $classes .= ' hidden';
34-
35-       list( $display_version ) = explode( '-', $wp_version );
36-       ?>
37-       <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
38-       <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
39-       <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e('Dismiss'); ?></a>
40-       <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
41-
42+function wp_welcome_panel() { ?>
43        <div class="welcome-panel-content">
44-       <h3><?php _e( 'Welcome to your new WordPress site!' ); ?></h3>
45-       <p class="about-description"><?php _e( 'If you need help getting started, check out our documentation on <a href="http://codex.wordpress.org/First_Steps_With_WordPress">First Steps with WordPress</a>. If you&#8217;d rather dive right in, here are a few things most people do first when they set up a new WordPress site. If you need help, use the Help tabs in the upper right corner to get information on how to use your current screen and where to go for more assistance.' ); ?></p>
46+       <h3><?php _e( 'Welcome to WordPress!' ); ?></h3>
47+       <p class="about-description"><?php _e( "We've assembled some links to get you started:" ); ?></p>
48        <div class="welcome-panel-column-container">
49        <div class="welcome-panel-column">
50-               <h4><span class="icon16 icon-settings"></span> <?php _e( 'Basic Settings' ); ?></h4>
51-               <p><?php _e( 'Here are a few easy things you can do to get your feet wet. Make sure to click Save on each Settings screen.' ); ?></p>
52-               <ul>
53-               <li><?php echo sprintf( __( '<a href="%s">Select your tagline and time zone</a>' ), esc_url( admin_url('options-general.php') ) ); ?></li>
54-               <li><?php echo sprintf( __( '<a href="%s">Turn comments on or off</a>' ), esc_url( admin_url('options-discussion.php') ) ); ?></li>
55-               <li><?php echo sprintf( __( '<a href="%s">Fill in your profile</a>' ), esc_url( get_edit_profile_url( get_current_user_id() ) ) ); ?></li>
56-               </ul>
57+               <h4><?php _e( 'Get Started' ); ?></h4>
58+               <p><?php _e( 'First, tweak the look of your site:' ); ?></p>
59+               <a class="button-primary welcome-button" href="<?php echo wp_customize_url() ?>?url=<?php echo esc_url( admin_url() ); ?>"><?php _e( 'Customize Your Site' ); ?></a>
60+               <?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( $args = array('allowed' => 'true') ) ) > 1 ) ) : ?>
61+                       <p><?php printf( __( 'or, ' ) . '<a href="%s">' . __( 'change your theme completely' ) . '</a>', esc_url( admin_url( 'themes.php?walkthrough=pointer_wp350_change_theme' ) ) ); ?></p>
62+               <?php endif; ?>
63        </div>
64        <div class="welcome-panel-column">
65-               <h4><span class="icon16 icon-page"></span> <?php _e( 'Add Real Content' ); ?></h4>
66-               <p><?php _e( 'Check out the sample page & post editors to see how it all works, then delete the default content and write your own!' ); ?></p>
67+               <h4><?php _e( 'Next Steps' ); ?></h4>
68                <ul>
69-               <li><?php echo sprintf( __( 'View the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ), esc_url( get_permalink( 2 ) ), esc_url( get_permalink( 1 ) ) ); ?></li>
70-               <li><?php echo sprintf( __( 'Delete the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ), esc_url( admin_url('edit.php?post_type=page') ), esc_url( admin_url('edit.php') ) ); ?></li>
71-               <li><?php echo sprintf( __( '<a href="%s">Create an About Me page</a>' ), esc_url( admin_url('edit.php?post_type=page') ) ); ?></li>
72-               <li><?php echo sprintf( __( '<a href="%s">Write your first post</a>' ), esc_url( admin_url('post-new.php') ) ); ?></li>
73+                       <?php if  ( ( 'page' == get_option( 'show_on_front' ) ) && '0' == get_option( 'page_for_posts' ) ) { ?>
74+                       <li><?php printf( '<a href="%s">' . __( 'Edit your front page' ) . '</a>', esc_url( admin_url( 'post.php?post=' . get_option( 'page_on_front' ) . '&action=edit' ) ) ); ?></li>
75+                       <li><?php printf( '<a href="%s">' . __( 'Add additional pages' ) . '</a>', esc_url( admin_url( 'post-new.php?post_type=page' ) ) ); ?></li>
76+               <?php } else if ( 'page' == get_option( 'show_on_front' ) ) { ?>
77+                       <li><?php printf( '<a href="%s">' . __( 'Edit your front page' ) . '</a>', esc_url( admin_url( 'post.php?post=' . get_option( 'page_on_front' ) . '&action=edit' ) ) ); ?></li>
78+                       <li><?php printf( '<a href="%s">' . __( 'Add additional pages' ) . '</a>', esc_url( admin_url( 'post-new.php?post_type=page' ) ) ); ?></li>
79+                       <li><?php printf( '<a href="%s">' . __( 'Add a blog post' ) . '</a>', esc_url( admin_url( 'post-new.php' ) ) ); ?></li>
80+               <?php } else { ?>
81+                       <li><?php printf( '<a href="%s">' . __( 'Write your first blog post' ) . '</a>', esc_url( admin_url( 'post-new.php' ) ) ); ?></li>
82+                       <li><?php printf( '<a href="%s">' . __( 'Add an About page' ) . '</a>', esc_url( admin_url( 'post-new.php?post_type=page' ) ) ); ?></li>
83+               <?php } ?>
84+                       <li><?php printf( '<a href="%s">' . __( 'View your site' ) . '</a>', esc_url( home_url() ) ); ?></li>
85                </ul>
86        </div>
87        <div class="welcome-panel-column welcome-panel-last">
88-               <h4><span class="icon16 icon-appearance"></span> <?php _e( 'Customize Your Site' ); ?></h4>
89-               <?php
90-               $theme = wp_get_theme();
91-               if ( $theme->errors() ) :
92-                       echo '<p>';
93-                       printf( __( '<a href="%s">Install a theme</a> to get started customizing your site.' ), esc_url( admin_url( 'themes.php' ) ) );
94-                       echo '</p>';
95-               else:
96-                       $customize_links = array();
97-                       if ( 'twentyeleven' == $theme->get_stylesheet() )
98-                               $customize_links[] = sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) );
99-
100-                       if ( current_theme_supports( 'custom-background' ) )
101-                               $customize_links[] = sprintf( __( '<a href="%s">Set a background color</a>' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) );
102-
103-                       if ( current_theme_supports( 'custom-header' ) )
104-                               $customize_links[] = sprintf( __( '<a href="%s">Select a new header image</a>' ), esc_url( admin_url( 'themes.php?page=custom-header' ) ) );
105-
106-                       if ( current_theme_supports( 'widgets' ) )
107-                               $customize_links[] = sprintf( __( '<a href="%s">Add some widgets</a>' ), esc_url( admin_url( 'widgets.php' ) ) );
108-
109-                       if ( ! empty( $customize_links ) ) {
110-                               echo '<p>';
111-                               printf( __( 'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>. If you stick with %1$s, here are a few ways to make your site look unique.' ), $theme->display('Name'), esc_url( admin_url( 'themes.php' ) ) );
112-                               echo '</p>';
113-                       ?>
114-                       <ul>
115-                               <?php foreach ( $customize_links as $customize_link ) : ?>
116-                               <li><?php echo $customize_link ?></li>
117-                               <?php endforeach; ?>
118-                       </ul>
119-                       <?php
120-                       } else {
121-                               echo '<p>';
122-                               printf( __( 'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>.' ), $theme->display('Name'), esc_url( admin_url( 'themes.php' ) ) );
123-                               echo '</p>';
124-                       }
125-               endif; ?>
126+               <h4><?php _e( 'Learn how to' ); ?></h4>
127+               <ul>
128+                       <li><?php printf( '<a id="wp350_add_images" href="%s">' . __( 'Add image/media' ) . '</a>', esc_url( admin_url( 'media-new.php' ) ) ); ?></li>
129+                       <li><?php printf( '<a id="wp350_widgets" href="%s">' . __( 'Add/remove widgets' ) . '</a>', esc_url( admin_url( 'widgets.php' ) ) ); ?></li>
130+                       <li><?php printf( '<a id="wp350_edit_menu" href="%s">' . __( 'Edit your navigation menu' ) . '</a>', esc_url( admin_url( 'nav-menus.php' ) ) ); ?></li>
131+               </ul>
132        </div>
133        </div>
134-       <p class="welcome-panel-dismiss"><?php printf( __( 'Already know what you&#8217;re doing? <a href="%s">Dismiss this message</a>.' ), esc_url( admin_url( '?welcome=0' ) ) ); ?></p>
135        </div>
136-       </div>
137        <?php
138 }
139Index: wp-admin/includes/screen.php
140===================================================================
141--- wp-admin/includes/screen.php        (revision 22011)
142+++ wp-admin/includes/screen.php        (working copy)
143@@ -937,7 +937,7 @@
144                                <?php
145                                        meta_box_prefs( $this );
146 
147-                                       if ( 'dashboard' === $this->id && current_user_can( 'edit_theme_options' ) ) {
148+                                       if ( 'dashboard' === $this->id && current_user_can( 'edit_theme_options' ) && has_action( 'welcome_panel' ) ) {
149                                                if ( isset( $_GET['welcome'] ) ) {
150                                                        $welcome_checked = empty( $_GET['welcome'] ) ? 0 : 1;
151                                                        update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked );
152Index: wp-admin/index.php
153===================================================================
154--- wp-admin/index.php  (revision 22011)
155+++ wp-admin/index.php  (working copy)
156@@ -106,8 +106,25 @@
157 <?php screen_icon(); ?>
158 <h2><?php echo esc_html( $title ); ?></h2>
159 
160-<?php wp_welcome_panel(); ?>
161+<?php if (has_action( 'welcome_panel' )) {
162 
163+       if ( ! current_user_can( 'edit_theme_options' ) )
164+               return;
165+
166+       $classes = 'welcome-panel';
167+
168+       $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
169+       // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
170+       $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
171+       if ( $hide )
172+               $classes .= ' hidden'; ?>
173+
174+       <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
175+       <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
176+       <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e( 'Dismiss' ); ?></a>
177+               <?php do_action( 'welcome_panel' ); ?>
178+       </div><?php } ?>
179+
180 <div id="dashboard-widgets-wrap">
181 
182 <?php wp_dashboard(); ?>
183Index: wp-admin/css/colors-fresh.css
184===================================================================
185--- wp-admin/css/colors-fresh.css       (revision 22011)
186+++ wp-admin/css/colors-fresh.css       (working copy)
187@@ -845,6 +845,12 @@
188 }
189 
190 .welcome-panel {
191+       background: #f5f5f5;
192+       background-image: -webkit-gradient(linear, left bottom, left top, from(#f5f5f5), to(#fafafa));
193+       background-image: -webkit-linear-gradient(bottom, #f5f5f5, #fafafa);
194+       background-image:    -moz-linear-gradient(bottom, #f5f5f5, #fafafa);
195+       background-image:      -o-linear-gradient(bottom, #f5f5f5, #fafafa);
196+       background-image: linear-gradient(to top, #f5f5f5, #fafafa);
197        border-color: #dfdfdf;
198 }
199 .welcome-panel p {
200@@ -854,7 +860,7 @@
201        color: #464646;
202 }
203 .welcome-panel h3 {
204-       text-shadow: 1px 1px 1px white;
205+       text-shadow: 1px 1px 1px #fff;
206 }
207 
208 .widget,
209Index: wp-admin/css/wp-admin-rtl.css
210===================================================================
211--- wp-admin/css/wp-admin-rtl.css       (revision 22011)
212+++ wp-admin/css/wp-admin-rtl.css       (working copy)
213@@ -590,11 +590,6 @@
214        float: right;
215 }
216 
217-.welcome-panel-content .about-description, .welcome-panel h3 {
218-       margin-left: 0;
219-       margin-right: 190px;
220-}
221-
222 .welcome-panel .welcome-panel-column {
223        margin: 0 -25px 0 5%;
224        padding-left: 0;
225Index: wp-admin/css/wp-admin.css
226===================================================================
227--- wp-admin/css/wp-admin.css   (revision 22011)
228+++ wp-admin/css/wp-admin.css   (working copy)
229@@ -1370,7 +1370,7 @@
230        position: absolute;
231        top: -1000em;
232        left: 146px;
233-       z-index: 999;
234+       z-index: 10000;
235        overflow: visible;
236        border-width: 1px;
237        border-style: solid;
238@@ -2176,26 +2176,34 @@
239 
240 /* Welcome Panel */
241 .welcome-panel {
242-       margin: 20px 8px;
243-       padding: 30px 10px 20px;
244-       border-width: 1px 0;
245+       position: relative;
246+       overflow: auto;
247+       margin: 20px 0;
248+       padding: 23px 10px 12px;
249+       border-width: 1px;
250        border-style: solid;
251-       position: relative;
252+       border-radius: 3px;
253+       font-size: 13px;
254        line-height: 1.6em;
255-       overflow: auto;
256 }
257 
258 .welcome-panel h3 {
259+       margin: 0;
260        font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
261        font-size: 32px;
262        font-weight: normal;
263        line-height: 1.2;
264-       margin: 0.1em 0 0.8em;
265 }
266 .welcome-panel h4 {
267-       font-size: 14px;
268+       margin: 1.33em 0 0;
269+       font-size: 13px;
270 }
271 
272+.welcome-panel .about-description {
273+       font-size: 18px;
274+       margin: 0;
275+}
276+
277 .welcome-panel .welcome-panel-close {
278        position: absolute;
279        top: 0;
280@@ -2206,52 +2214,45 @@
281 }
282 
283 .welcome-panel .welcome-panel-close:before {
284-       background: url('../images/xit.gif') 0 17% no-repeat;
285        content: ' ';
286+       position: absolute;
287+       left: -12px;
288+       width: 10px;
289        height: 100%;
290-       width: 10px;
291-       left: -12px;
292-       position: absolute;
293+       background: url('../images/xit.gif') 0 17% no-repeat;
294 }
295 
296 .welcome-panel .welcome-panel-close:hover:before {
297        background-position: 100% 17%;
298 }
299 
300-.welcome-panel .wp-badge {
301-       float: left;
302-       margin-bottom: 20px;
303+.welcome-button {
304+       margin: -9px 0 3px;
305+       padding: 1em 3em;
306+       font: normal 15px/1 sans-serif;
307 }
308 
309 .welcome-panel-content {
310+       margin-left: 13px;
311        max-width: 1500px;
312 }
313 
314-.welcome-panel-content .about-description,
315-.welcome-panel h3 {
316-       margin-left: 190px;
317-}
318-
319-.welcome-panel p.welcome-panel-dismiss {
320-       clear: both;
321-       padding: 1em 0 0 0;
322-}
323-
324 .welcome-panel .welcome-panel-column-container {
325        clear: both;
326        overflow: hidden;
327        position: relative;
328-       padding-left: 26px;
329 }
330 
331 .welcome-panel .welcome-panel-column {
332-       margin: 0 5% 0 -25px;
333-       padding-left: 25px;
334-       width: 30%;
335+       width: 32%;
336        min-width: 200px;
337        float: left;
338 }
339 
340+.welcome-panel .welcome-panel-column:first-child {
341+       width: 36%;
342+}
343+
344 .welcome-panel .welcome-panel-column.welcome-panel-last {
345        margin-right: 0;
346 }
347@@ -2260,8 +2261,12 @@
348        margin-left: -32px;
349 }
350 
351+.welcome-panel-column p {
352+       margin-top: 5px;
353+}
354+
355 .welcome-panel .welcome-panel-column ul {
356-       margin: 1.6em 1em 1em 1.3em;
357+       margin: 0.4em 1em 1em 1.3em;
358 }
359 
360 .welcome-panel .welcome-panel-column li {
361@@ -2269,7 +2274,26 @@
362        padding-left: 2px;
363 }
364 
365+@media screen and (max-width: 870px) {
366+       .welcome-button {
367+               font-size: 14px;
368+               padding: 1em 2.3em;
369+       }
370 
371+       .welcome-panel .welcome-panel-column, .welcome-panel .welcome-panel-column:first-child {
372+               display: block;
373+               float: none;
374+               width: 100%;
375+       }
376+       .welcome-panel .welcome-panel-column li {
377+               display: inline-block;
378+               margin-right: 13px;
379+       }
380+       .welcome-panel .welcome-panel-column ul {
381+               margin: 0.4em 0 0;
382+       }
383+}
384+
385 /*------------------------------------------------------------------------------
386   10.0 - List Posts (/Pages/etc)
387 ------------------------------------------------------------------------------*/
388Index: wp-admin/css/colors-classic.css
389===================================================================
390--- wp-admin/css/colors-classic.css     (revision 22011)
391+++ wp-admin/css/colors-classic.css     (working copy)
392@@ -854,6 +854,7 @@
393 }
394 
395 .welcome-panel {
396+       background: #f7fcfe;
397        border-color: #d1e5ee;
398 }
399 .welcome-panel p {
400@@ -863,7 +864,7 @@
401        color: #464646;
402 }
403 .welcome-panel h3 {
404-       text-shadow: 1px 1px 1px white;
405+       text-shadow: 1px 1px 1px #fff;
406 }
407 
408 .widget,