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 */
2017-11-30 18:11:00 -05: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' );
}
2017-11-30 18:11:00 -05:00
if ( current_user_can ( 'upload_files' ) ) {
2012-10-01 10:58:05 -04:00
wp_enqueue_script ( 'media-upload' );
2017-11-30 18:11:00 -05:00
}
2008-08-04 17:01:09 -04:00
add_thickbox ();
2006-11-18 18:12:39 -05:00
2017-11-30 18:11:00 -05:00
if ( wp_is_mobile () ) {
2012-04-10 22:20:51 -04:00
wp_enqueue_script ( 'jquery-touch-punch' );
2017-11-30 18:11:00 -05:00
}
2012-04-10 22:20:51 -04:00
2017-11-30 18:11:00 -05: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 ();
2017-11-30 18:11:00 -05:00
$screen -> add_help_tab (
array (
'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
2017-11-30 18:11:00 -05:00
$screen -> add_help_tab (
array (
'id' => 'help-navigation' ,
'title' => __ ( 'Navigation' ),
'content' => $help ,
)
);
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
2017-11-30 18:11:00 -05:00
$screen -> add_help_tab (
array (
'id' => 'help-layout' ,
'title' => __ ( 'Layout' ),
'content' => $help ,
)
);
2011-09-27 20:57:56 -04:00
2017-11-30 18:11:00 -05:00
$help = '<p>' . __ ( 'The boxes on your Dashboard screen are:' ) . '</p>' ;
2018-03-04 22:32:30 -05:00
2017-11-30 18:11:00 -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>' ;
2017-11-30 18:11:00 -05:00
}
2018-03-04 22:32:30 -05:00
$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>' ;
2017-11-30 18:11:00 -05:00
if ( is_blog_admin () && current_user_can ( 'edit_posts' ) ) {
2018-03-04 19:24:30 -05: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 3 most recent draft posts you've started. " ) . '</p>' ;
2017-11-30 18:11:00 -05:00
}
2018-03-04 22:32:30 -05:00
2018-03-04 22:17:31 -05:00
$help .= '<p>' . sprintf (
/* translators: %s: WordPress Planet URL */
__ ( '<strong>WordPress Events and News</strong> — Upcoming events near you as well as the latest news from the official WordPress project and the <a href="%s">WordPress Planet</a>.' ),
__ ( 'https://planet.wordpress.org/' )
) . '</p>' ;
2018-03-04 22:32:30 -05:00
2017-11-30 18:11:00 -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>' ;
2017-11-30 18:11:00 -05:00
}
2011-09-27 20:57:56 -04:00
2017-11-30 18:11:00 -05:00
$screen -> add_help_tab (
array (
'id' => 'help-content' ,
'title' => __ ( 'Content' ),
'content' => $help ,
)
);
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
2017-11-30 18:11:00 -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
2017-10-23 16:48:47 -04:00
$hide = 0 == $option || ( 2 == $option && wp_get_current_user () -> user_email != get_option ( 'admin_email' ) );
2017-11-30 18:11:00 -05:00
if ( $hide ) {
$classes .= ' hidden' ;
}
2018-08-16 21:51:36 -04:00
?>
2012-09-26 15:44:43 -04:00
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' );