2003-06-01 03:47:29 -04:00
< ? php
2008-08-11 16:26:31 -04:00
/**
2011-04-28 11:24:49 -04:00
* Dashboard Administration Screen
2008-08-11 16:26:31 -04:00
*
* @ package WordPress
* @ subpackage Administration
*/
/** Load WordPress Bootstrap */
2013-09-24 20:18:11 -04:00
require_once ( dirname ( __FILE__ ) . '/admin.php' );
2006-11-18 18:12:39 -05:00
2008-08-11 16:26:31 -04:00
/** Load WordPress dashboard API */
2008-03-24 16:36:46 -04:00
require_once ( ABSPATH . 'wp-admin/includes/dashboard.php' );
2008-02-02 02:57:51 -05:00
wp_dashboard_setup ();
2008-10-08 19:32:34 -04:00
wp_enqueue_script ( 'dashboard' );
Dashboard: Update the existing WordPress News dashboard widget to also include upcoming meetup events and WordCamps near the current user’s location.
Props @afercia, @andreamiddleton, @azaozz, @camikaos, @coreymckrill, @chanthaboune, @courtneypk, @dd32, @iandunn, @iseulde, @mapk, @mayukojpn, @melchoyce, @nao, @obenland, @pento, @samuelsidler, @stephdau, @tellyworth.
See #40702.
Built from https://develop.svn.wordpress.org/trunk@40607
git-svn-id: http://core.svn.wordpress.org/trunk@40477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 16:04:42 -04:00
2016-07-05 11:37:28 -04:00
if ( current_user_can ( 'install_plugins' ) ) {
2012-10-01 10:58:05 -04:00
wp_enqueue_script ( 'plugin-install' );
2016-07-05 11:37:28 -04:00
wp_enqueue_script ( 'updates' );
}
2012-10-01 10:58:05 -04:00
if ( current_user_can ( 'upload_files' ) )
wp_enqueue_script ( 'media-upload' );
2008-08-04 17:01:09 -04:00
add_thickbox ();
2006-11-18 18:12:39 -05:00
2012-04-10 22:20:51 -04:00
if ( wp_is_mobile () )
wp_enqueue_script ( 'jquery-touch-punch' );
2007-09-03 19:32:58 -04:00
$title = __ ( 'Dashboard' );
2006-11-18 02:31:29 -05:00
$parent_file = 'index.php' ;
2010-01-15 11:58:36 -05:00
2016-06-10 17:43:29 -04:00
$help = '<p>' . __ ( 'Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab above the screen title.' ) . '</p>' ;
2011-10-19 12:41:26 -04:00
2012-09-03 22:46:01 -04:00
$screen = get_current_screen ();
$screen -> add_help_tab ( array (
2011-11-30 20:39:21 -05:00
'id' => 'overview' ,
'title' => __ ( 'Overview' ),
'content' => $help ,
) );
2011-09-27 20:57:56 -04:00
2011-10-07 01:23:33 -04:00
// Help tabs
2011-09-27 20:57:56 -04:00
2013-11-13 17:09:10 -05:00
$help = '<p>' . __ ( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '</p>' ;
$help .= '<p>' . __ ( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '</p>' ;
2011-09-27 20:57:56 -04:00
2012-09-03 22:46:01 -04:00
$screen -> add_help_tab ( array (
2011-11-28 11:32:33 -05:00
'id' => 'help-navigation' ,
2013-11-13 17:09:10 -05:00
'title' => __ ( 'Navigation' ),
2011-11-30 20:39:21 -05:00
'content' => $help ,
2011-09-30 20:24:44 -04:00
) );
2011-09-27 20:57:56 -04:00
2013-11-13 17:09:10 -05:00
$help = '<p>' . __ ( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '</p>' ;
2015-08-19 00:53:25 -04:00
$help .= '<p>' . __ ( '<strong>Screen Options</strong> — Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '</p>' ;
$help .= '<p>' . __ ( '<strong>Drag and Drop</strong> — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '</p>' ;
$help .= '<p>' . __ ( '<strong>Box Controls</strong> — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.' ) . '</p>' ;
2011-09-27 20:57:56 -04:00
2012-09-03 22:46:01 -04:00
$screen -> add_help_tab ( array (
2011-11-23 19:21:39 -05:00
'id' => 'help-layout' ,
2013-11-13 17:09:10 -05:00
'title' => __ ( 'Layout' ),
2011-11-30 20:39:21 -05:00
'content' => $help ,
2011-09-30 20:24:44 -04:00
) );
2011-09-27 20:57:56 -04:00
2013-11-13 17:09:10 -05:00
$help = '<p>' . __ ( 'The boxes on your Dashboard screen are:' ) . '</p>' ;
2012-02-14 12:12:27 -05:00
if ( current_user_can ( 'edit_posts' ) )
2015-08-19 00:53:25 -04:00
$help .= '<p>' . __ ( '<strong>At A Glance</strong> — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '</p>' ;
$help .= '<p>' . __ ( '<strong>Activity</strong> — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '</p>' ;
2013-11-13 17:09:10 -05:00
if ( is_blog_admin () && current_user_can ( 'edit_posts' ) )
2015-08-19 00:53:25 -04:00
$help .= '<p>' . __ ( " <strong>Quick Draft</strong> — Allows you to create a new post and save it as a draft. Also displays links to the 5 most recent draft posts you've started. " ) . '</p>' ;
2012-02-14 12:12:27 -05:00
if ( ! is_multisite () && current_user_can ( 'install_plugins' ) )
2016-05-24 17:22:28 -04:00
$help .= '<p>' . sprintf (
/* translators: %s: WordPress Planet URL */
__ ( '<strong>WordPress News</strong> — Latest news from the official WordPress project, the <a href="%s">WordPress Planet</a>, and popular plugins.' ),
__ ( 'https://planet.wordpress.org/' )
) . '</p>' ;
2013-11-13 17:09:10 -05:00
else
2016-05-24 17:22:28 -04:00
$help .= '<p>' . sprintf (
/* translators: %s: WordPress Planet URL */
__ ( '<strong>WordPress News</strong> — Latest news from the official WordPress project and the <a href="%s">WordPress Planet</a>.' ),
__ ( 'https://planet.wordpress.org/' )
) . '</p>' ;
2012-02-14 12:23:31 -05:00
if ( current_user_can ( 'edit_theme_options' ) )
2015-08-19 00:53:25 -04:00
$help .= '<p>' . __ ( '<strong>Welcome</strong> — Shows links for some of the most common tasks when setting up a new site.' ) . '</p>' ;
2011-09-27 20:57:56 -04:00
2012-09-03 22:46:01 -04:00
$screen -> add_help_tab ( array (
2011-11-23 19:21:39 -05:00
'id' => 'help-content' ,
2013-11-13 17:09:10 -05:00
'title' => __ ( 'Content' ),
2011-11-30 20:39:21 -05:00
'content' => $help ,
2011-09-30 20:24:44 -04:00
) );
2011-09-27 20:57:56 -04:00
2011-11-30 20:39:21 -05:00
unset ( $help );
2012-09-03 22:46:01 -04:00
$screen -> set_help_sidebar (
2011-10-07 00:57:12 -04:00
'<p><strong>' . __ ( 'For more information:' ) . '</strong></p>' .
2016-10-04 16:27:33 -04:00
'<p>' . __ ( '<a href="https://codex.wordpress.org/Dashboard_Screen">Documentation on Dashboard</a>' ) . '</p>' .
'<p>' . __ ( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>'
2011-10-07 00:57:12 -04:00
);
2012-05-03 12:41:59 -04:00
2013-11-14 18:59:09 -05:00
include ( ABSPATH . 'wp-admin/admin-header.php' );
2004-12-18 19:10:10 -05:00
?>
2003-06-01 03:47:29 -04:00
2011-09-14 03:02:46 -04:00
< div class = " wrap " >
2015-06-27 11:41:25 -04:00
< h1 >< ? php echo esc_html ( $title ); ?> </h1>
2008-10-17 16:02:03 -04:00
Dashboard: Introduce the "Try Gutenberg" callout.
To encourage folks to prepare for Gutenberg, this new Dashboard box allows site users to easily install and try the Gutenberg plugin now, or to install the Classic Editor plugin before WordPress 5.0 is released.
Props pento, melchoyce, joen, karmatosed, joemcgill, SergeyBiryukov, jorbin, bph, Clorith, afercia, chanthaboune, chrislema, kjellr, matveb, michelleweber.
Fixes #41316.
Built from https://develop.svn.wordpress.org/branches/4.9@43502
git-svn-id: http://core.svn.wordpress.org/branches/4.9@43329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-18 02:42:26 -04:00
< ? php if ( has_action ( 'try_gutenberg_panel' ) ) :
$classes = 'try-gutenberg-panel' ;
$option = get_user_meta ( get_current_user_id (), 'show_try_gutenberg_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 = " try-gutenberg-panel " class = " <?php echo esc_attr( $classes ); ?> " >
< ? php wp_nonce_field ( 'try-gutenberg-panel-nonce' , 'trygutenbergpanelnonce' , false ); ?>
< a class = " try-gutenberg-panel-close " href = " <?php echo esc_url( admin_url( '?try_gutenberg=0' ) ); ?> " aria - label = " <?php esc_attr_e( 'Dismiss the Try Gutenberg panel' ); ?> " >< ? php _e ( 'Dismiss' ); ?> </a>
< ? php
/**
* Add content to the Try Gutenberg panel on the admin dashboard .
*
* To remove the Try Gutenberg panel , use remove_action () :
*
* remove_action ( 'try_gutenberg_panel' , 'wp_try_gutenberg_panel' );
*
* @ since 4.9 . 8
*/
do_action ( 'try_gutenberg_panel' );
?>
</ div >
< ? php endif ; ?>
2013-11-14 18:59:09 -05:00
< ? php if ( has_action ( 'welcome_panel' ) && current_user_can ( 'edit_theme_options' ) ) :
2012-09-26 15:44:43 -04:00
$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
Dashboard: Introduce the "Try Gutenberg" callout.
To encourage folks to prepare for Gutenberg, this new Dashboard box allows site users to easily install and try the Gutenberg plugin now, or to install the Classic Editor plugin before WordPress 5.0 is released.
Props pento, melchoyce, joen, karmatosed, joemcgill, SergeyBiryukov, jorbin, bph, Clorith, afercia, chanthaboune, chrislema, kjellr, matveb, michelleweber.
Fixes #41316.
Built from https://develop.svn.wordpress.org/branches/4.9@43502
git-svn-id: http://core.svn.wordpress.org/branches/4.9@43329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-18 02:42:26 -04:00
$hide = '0' === $option || ( '2' === $option && wp_get_current_user () -> user_email != get_option ( 'admin_email' ) );
2012-09-26 15:44:43 -04:00
if ( $hide )
$classes .= ' hidden' ; ?>
2013-11-13 17:09:10 -05:00
< div id = " welcome-panel " class = " <?php echo esc_attr( $classes ); ?> " >
< ? php wp_nonce_field ( 'welcome-panel-nonce' , 'welcomepanelnonce' , false ); ?>
2016-01-05 09:19:28 -05:00
< a class = " welcome-panel-close " href = " <?php echo esc_url( admin_url( '?welcome=0' ) ); ?> " aria - label = " <?php esc_attr_e( 'Dismiss the welcome panel' ); ?> " >< ? php _e ( 'Dismiss' ); ?> </a>
2013-09-05 12:07:09 -04:00
< ? php
/**
2013-09-05 21:38:09 -04:00
* Add content to the welcome panel on the admin dashboard .
2013-10-24 22:29:52 -04:00
*
2016-05-02 00:00:28 -04:00
* To remove the default welcome panel , use remove_action () :
2014-11-24 00:39:22 -05:00
*
* remove_action ( 'welcome_panel' , 'wp_welcome_panel' );
2013-10-24 22:29:52 -04:00
*
2013-09-05 12:07:09 -04:00
* @ since 3.5 . 0
*/
2013-10-24 22:29:52 -04:00
do_action ( 'welcome_panel' );
2013-09-05 12:07:09 -04:00
?>
2012-09-26 15:44:43 -04:00
</ div >
2013-11-14 18:59:09 -05:00
< ? php endif ; ?>
2007-12-20 15:23:30 -05:00
2013-11-13 17:09:10 -05:00
< div id = " dashboard-widgets-wrap " >
< ? php wp_dashboard (); ?>
</ div ><!-- dashboard - widgets - wrap -->
2008-03-10 01:47:07 -04:00
2008-02-02 02:57:51 -05:00
</ div ><!-- wrap -->
2004-02-02 16:54:32 -05:00
2013-11-14 18:59:09 -05:00
< ? php
Dashboard: Update the existing WordPress News dashboard widget to also include upcoming meetup events and WordCamps near the current user’s location.
Props @afercia, @andreamiddleton, @azaozz, @camikaos, @coreymckrill, @chanthaboune, @courtneypk, @dd32, @iandunn, @iseulde, @mapk, @mayukojpn, @melchoyce, @nao, @obenland, @pento, @samuelsidler, @stephdau, @tellyworth.
See #40702.
Built from https://develop.svn.wordpress.org/trunk@40607
git-svn-id: http://core.svn.wordpress.org/trunk@40477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 16:04:42 -04:00
wp_print_community_events_templates ();
2013-11-14 18:59:09 -05:00
require ( ABSPATH . 'wp-admin/admin-footer.php' );