mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
New design and content for the welcome panel. First pass.
props lessbloat, helenyhou, georgestephanis, sabreuse, ryelle. see #21368. git-svn-id: http://core.svn.wordpress.org/trunk@22018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
50be456284
commit
51ad055a68
@ -854,6 +854,7 @@ table.widefat span.spam a,
|
||||
}
|
||||
|
||||
.welcome-panel {
|
||||
background: #f7fcfe;
|
||||
border-color: #d1e5ee;
|
||||
}
|
||||
.welcome-panel p {
|
||||
@ -863,7 +864,7 @@ table.widefat span.spam a,
|
||||
color: #464646;
|
||||
}
|
||||
.welcome-panel h3 {
|
||||
text-shadow: 1px 1px 1px white;
|
||||
text-shadow: 1px 1px 1px #fff;
|
||||
}
|
||||
|
||||
.widget,
|
||||
|
@ -845,6 +845,12 @@ table.widefat span.spam a,
|
||||
}
|
||||
|
||||
.welcome-panel {
|
||||
background: #f5f5f5;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, from(#f5f5f5), to(#fafafa));
|
||||
background-image: -webkit-linear-gradient(bottom, #f5f5f5, #fafafa);
|
||||
background-image: -moz-linear-gradient(bottom, #f5f5f5, #fafafa);
|
||||
background-image: -o-linear-gradient(bottom, #f5f5f5, #fafafa);
|
||||
background-image: linear-gradient(to top, #f5f5f5, #fafafa);
|
||||
border-color: #dfdfdf;
|
||||
}
|
||||
.welcome-panel p {
|
||||
@ -854,7 +860,7 @@ table.widefat span.spam a,
|
||||
color: #464646;
|
||||
}
|
||||
.welcome-panel h3 {
|
||||
text-shadow: 1px 1px 1px white;
|
||||
text-shadow: 1px 1px 1px #fff;
|
||||
}
|
||||
|
||||
.widget,
|
||||
|
@ -590,11 +590,6 @@ form.upgrade .hint {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.welcome-panel-content .about-description, .welcome-panel h3 {
|
||||
margin-left: 0;
|
||||
margin-right: 190px;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column {
|
||||
margin: 0 -25px 0 5%;
|
||||
padding-left: 0;
|
||||
|
@ -1370,7 +1370,7 @@ form.upgrade .hint {
|
||||
position: absolute;
|
||||
top: -1000em;
|
||||
left: 146px;
|
||||
z-index: 999;
|
||||
z-index: 10000;
|
||||
overflow: visible;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
@ -2176,24 +2176,32 @@ html.wp-toolbar {
|
||||
|
||||
/* Welcome Panel */
|
||||
.welcome-panel {
|
||||
margin: 20px 8px;
|
||||
padding: 30px 10px 20px;
|
||||
border-width: 1px 0;
|
||||
border-style: solid;
|
||||
position: relative;
|
||||
line-height: 1.6em;
|
||||
overflow: auto;
|
||||
margin: 20px 0;
|
||||
padding: 23px 10px 12px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-radius: 3px;
|
||||
font-size: 13px;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
.welcome-panel h3 {
|
||||
margin: 0;
|
||||
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
|
||||
font-size: 32px;
|
||||
font-weight: normal;
|
||||
line-height: 1.2;
|
||||
margin: 0.1em 0 0.8em;
|
||||
}
|
||||
.welcome-panel h4 {
|
||||
font-size: 14px;
|
||||
margin: 1.33em 0 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.welcome-panel .about-description {
|
||||
font-size: 18px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-close {
|
||||
@ -2206,52 +2214,45 @@ html.wp-toolbar {
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-close:before {
|
||||
background: url('../images/xit.gif') 0 17% no-repeat;
|
||||
content: ' ';
|
||||
height: 100%;
|
||||
width: 10px;
|
||||
left: -12px;
|
||||
position: absolute;
|
||||
left: -12px;
|
||||
width: 10px;
|
||||
height: 100%;
|
||||
background: url('../images/xit.gif') 0 17% no-repeat;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-close:hover:before {
|
||||
background-position: 100% 17%;
|
||||
}
|
||||
|
||||
.welcome-panel .wp-badge {
|
||||
float: left;
|
||||
margin-bottom: 20px;
|
||||
.welcome-button {
|
||||
margin: -9px 0 3px;
|
||||
padding: 1em 3em;
|
||||
font: normal 15px/1 sans-serif;
|
||||
}
|
||||
|
||||
.welcome-panel-content {
|
||||
margin-left: 13px;
|
||||
max-width: 1500px;
|
||||
}
|
||||
|
||||
.welcome-panel-content .about-description,
|
||||
.welcome-panel h3 {
|
||||
margin-left: 190px;
|
||||
}
|
||||
|
||||
.welcome-panel p.welcome-panel-dismiss {
|
||||
clear: both;
|
||||
padding: 1em 0 0 0;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column-container {
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
padding-left: 26px;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column {
|
||||
margin: 0 5% 0 -25px;
|
||||
padding-left: 25px;
|
||||
width: 30%;
|
||||
width: 32%;
|
||||
min-width: 200px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column:first-child {
|
||||
width: 36%;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column.welcome-panel-last {
|
||||
margin-right: 0;
|
||||
}
|
||||
@ -2260,8 +2261,12 @@ html.wp-toolbar {
|
||||
margin-left: -32px;
|
||||
}
|
||||
|
||||
.welcome-panel-column p {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column ul {
|
||||
margin: 1.6em 1em 1em 1.3em;
|
||||
margin: 0.4em 1em 1em 1.3em;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column li {
|
||||
@ -2269,6 +2274,25 @@ html.wp-toolbar {
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 870px) {
|
||||
.welcome-button {
|
||||
font-size: 14px;
|
||||
padding: 1em 2.3em;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column, .welcome-panel .welcome-panel-column:first-child {
|
||||
display: block;
|
||||
float: none;
|
||||
width: 100%;
|
||||
}
|
||||
.welcome-panel .welcome-panel-column li {
|
||||
display: inline-block;
|
||||
margin-right: 13px;
|
||||
}
|
||||
.welcome-panel .welcome-panel-column ul {
|
||||
margin: 0.4em 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
10.0 - List Posts (/Pages/etc)
|
||||
|
@ -1232,92 +1232,45 @@ function wp_dashboard_empty() {}
|
||||
* @since 3.3.0
|
||||
*/
|
||||
function wp_welcome_panel() {
|
||||
global $wp_version;
|
||||
|
||||
if ( ! current_user_can( 'edit_theme_options' ) )
|
||||
return;
|
||||
|
||||
$classes = 'welcome-panel';
|
||||
|
||||
$option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
|
||||
// 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
|
||||
$hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
|
||||
if ( $hide )
|
||||
$classes .= ' hidden';
|
||||
|
||||
list( $display_version ) = explode( '-', $wp_version );
|
||||
?>
|
||||
<div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
|
||||
<?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
|
||||
<a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e('Dismiss'); ?></a>
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
<div class="welcome-panel-content">
|
||||
<h3><?php _e( 'Welcome to your new WordPress site!' ); ?></h3>
|
||||
<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’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>
|
||||
<h3><?php _e( 'Welcome to WordPress!' ); ?></h3>
|
||||
<p class="about-description"><?php _e( 'We’ve assembled some links to get you started:' ); ?></p>
|
||||
<div class="welcome-panel-column-container">
|
||||
<div class="welcome-panel-column">
|
||||
<h4><span class="icon16 icon-settings"></span> <?php _e( 'Basic Settings' ); ?></h4>
|
||||
<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>
|
||||
<ul>
|
||||
<li><?php echo sprintf( __( '<a href="%s">Select your tagline and time zone</a>' ), esc_url( admin_url('options-general.php') ) ); ?></li>
|
||||
<li><?php echo sprintf( __( '<a href="%s">Turn comments on or off</a>' ), esc_url( admin_url('options-discussion.php') ) ); ?></li>
|
||||
<li><?php echo sprintf( __( '<a href="%s">Fill in your profile</a>' ), esc_url( get_edit_profile_url( get_current_user_id() ) ) ); ?></li>
|
||||
</ul>
|
||||
<h4><?php _e( 'Get Started' ); ?></h4>
|
||||
<p><?php _e( 'First, tweak the look of your site:' ); ?></p>
|
||||
<a class="button-primary welcome-button" href="<?php echo add_query_arg( 'url', urlencode( admin_url( '/' ) ), wp_customize_url() ); ?>"><?php _e( 'Customize Your Site' ); ?></a>
|
||||
<?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?>
|
||||
<p><?php printf( __( 'or, <a href="%s">change your theme completely</a>' ), admin_url( 'themes.php' ) ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="welcome-panel-column">
|
||||
<h4><span class="icon16 icon-page"></span> <?php _e( 'Add Real Content' ); ?></h4>
|
||||
<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>
|
||||
<h4><?php _e( 'Next Steps' ); ?></h4>
|
||||
<ul>
|
||||
<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>
|
||||
<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>
|
||||
<li><?php echo sprintf( __( '<a href="%s">Create an About Me page</a>' ), esc_url( admin_url('edit.php?post_type=page') ) ); ?></li>
|
||||
<li><?php echo sprintf( __( '<a href="%s">Write your first post</a>' ), esc_url( admin_url('post-new.php') ) ); ?></li>
|
||||
<?php if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_for_posts' ) ) : ?>
|
||||
<li><?php printf( '<a href="%s">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li>
|
||||
<li><?php printf( '<a href="%s">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
|
||||
<?php elseif ( 'page' == get_option( 'show_on_front' ) ) : ?>
|
||||
<li><?php printf( '<a href="%s">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li>
|
||||
<li><?php printf( '<a href="%s">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
|
||||
<li><?php printf( '<a href="%s">' . __( 'Add a blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
|
||||
<?php else : ?>
|
||||
<li><?php printf( '<a href="%s">' . __( 'Write your first blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
|
||||
<li><?php printf( '<a href="%s">' . __( 'Add an About page' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
|
||||
<?php endif; ?>
|
||||
<li><?php printf( '<a href="%s">' . __( 'View your site' ) . '</a>', home_url( '/' ) ); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="welcome-panel-column welcome-panel-last">
|
||||
<h4><span class="icon16 icon-appearance"></span> <?php _e( 'Customize Your Site' ); ?></h4>
|
||||
<?php
|
||||
$theme = wp_get_theme();
|
||||
if ( $theme->errors() ) :
|
||||
echo '<p>';
|
||||
printf( __( '<a href="%s">Install a theme</a> to get started customizing your site.' ), esc_url( admin_url( 'themes.php' ) ) );
|
||||
echo '</p>';
|
||||
else:
|
||||
$customize_links = array();
|
||||
if ( 'twentyeleven' == $theme->get_stylesheet() )
|
||||
$customize_links[] = sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) );
|
||||
|
||||
if ( current_theme_supports( 'custom-background' ) )
|
||||
$customize_links[] = sprintf( __( '<a href="%s">Set a background color</a>' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) );
|
||||
|
||||
if ( current_theme_supports( 'custom-header' ) )
|
||||
$customize_links[] = sprintf( __( '<a href="%s">Select a new header image</a>' ), esc_url( admin_url( 'themes.php?page=custom-header' ) ) );
|
||||
|
||||
if ( current_theme_supports( 'widgets' ) )
|
||||
$customize_links[] = sprintf( __( '<a href="%s">Add some widgets</a>' ), esc_url( admin_url( 'widgets.php' ) ) );
|
||||
|
||||
if ( ! empty( $customize_links ) ) {
|
||||
echo '<p>';
|
||||
printf( __( 'Use the current theme — %1$s — 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' ) ) );
|
||||
echo '</p>';
|
||||
?>
|
||||
<ul>
|
||||
<?php foreach ( $customize_links as $customize_link ) : ?>
|
||||
<li><?php echo $customize_link ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php
|
||||
} else {
|
||||
echo '<p>';
|
||||
printf( __( 'Use the current theme — %1$s — or <a href="%2$s">choose a new one</a>.' ), $theme->display('Name'), esc_url( admin_url( 'themes.php' ) ) );
|
||||
echo '</p>';
|
||||
}
|
||||
endif; ?>
|
||||
<h4><?php _e( 'Learn How To' ); ?></h4>
|
||||
<ul>
|
||||
<li><?php printf( '<a id="wp350_add_images" href="%s">' . __( 'Add image/media' ) . '</a>', admin_url( 'media-new.php' ) ); ?></li>
|
||||
<li><?php printf( '<a id="wp350_widgets" href="%s">' . __( 'Add/remove widgets' ) . '</a>', admin_url( 'widgets.php' ) ); ?></li>
|
||||
<li><?php printf( '<a id="wp350_edit_menu" href="%s">' . __( 'Edit your navigation menu' ) . '</a>', admin_url( 'nav-menus.php' ) ); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<p class="welcome-panel-dismiss"><?php printf( __( 'Already know what you’re doing? <a href="%s">Dismiss this message</a>.' ), esc_url( admin_url( '?welcome=0' ) ) ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
@ -937,7 +937,7 @@ final class WP_Screen {
|
||||
<?php
|
||||
meta_box_prefs( $this );
|
||||
|
||||
if ( 'dashboard' === $this->id && current_user_can( 'edit_theme_options' ) ) {
|
||||
if ( 'dashboard' === $this->id && has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) {
|
||||
if ( isset( $_GET['welcome'] ) ) {
|
||||
$welcome_checked = empty( $_GET['welcome'] ) ? 0 : 1;
|
||||
update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked );
|
||||
|
@ -106,7 +106,21 @@ $today = current_time('mysql', 1);
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
|
||||
<?php wp_welcome_panel(); ?>
|
||||
<?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
|
||||
$classes = 'welcome-panel';
|
||||
|
||||
$option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
|
||||
// 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
|
||||
$hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
|
||||
if ( $hide )
|
||||
$classes .= ' hidden'; ?>
|
||||
|
||||
<div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
|
||||
<?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
|
||||
<a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e( 'Dismiss' ); ?></a>
|
||||
<?php do_action( 'welcome_panel' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="dashboard-widgets-wrap">
|
||||
|
||||
|
@ -257,6 +257,7 @@ add_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts'
|
||||
add_action( 'admin_init', 'send_frame_options_header', 10, 0 );
|
||||
add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' );
|
||||
add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment' );
|
||||
add_action( 'welcome_panel', 'wp_welcome_panel' );
|
||||
|
||||
// Navigation menu actions
|
||||
add_action( 'delete_post', '_wp_delete_post_menu_item' );
|
||||
|
Loading…
Reference in New Issue
Block a user