]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/index.php
WordPress 4.4
[autoinstalls/wordpress.git] / wp-admin / index.php
1 <?php
2 /**
3  * Dashboard Administration Screen
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 /** Load WordPress Bootstrap */
10 require_once( dirname( __FILE__ ) . '/admin.php' );
11
12 /** Load WordPress dashboard API */
13 require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
14
15 wp_dashboard_setup();
16
17 wp_enqueue_script( 'dashboard' );
18 if ( current_user_can( 'edit_theme_options' ) )
19         wp_enqueue_script( 'customize-loader' );
20 if ( current_user_can( 'install_plugins' ) )
21         wp_enqueue_script( 'plugin-install' );
22 if ( current_user_can( 'upload_files' ) )
23         wp_enqueue_script( 'media-upload' );
24 add_thickbox();
25
26 if ( wp_is_mobile() )
27         wp_enqueue_script( 'jquery-touch-punch' );
28
29 $title = __('Dashboard');
30 $parent_file = 'index.php';
31
32 $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 in the upper corner.' ) . '</p>';
33
34 // Not using chaining here, so as to be parseable by PHP4.
35 $screen = get_current_screen();
36
37 $screen->add_help_tab( array(
38         'id'      => 'overview',
39         'title'   => __( 'Overview' ),
40         'content' => $help,
41 ) );
42
43 // Help tabs
44
45 $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>';
46 $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>';
47
48 $screen->add_help_tab( array(
49         'id'      => 'help-navigation',
50         'title'   => __( 'Navigation' ),
51         'content' => $help,
52 ) );
53
54 $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>';
55 $help .= '<p>' . __( '<strong>Screen Options</strong> &mdash; Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '</p>';
56 $help .= '<p>' . __( '<strong>Drag and Drop</strong> &mdash; 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>';
57 $help .= '<p>' . __( '<strong>Box Controls</strong> &mdash; 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 &#8220;Configure&#8221; link in the title bar if you hover over it.' ) . '</p>';
58
59 $screen->add_help_tab( array(
60         'id'      => 'help-layout',
61         'title'   => __( 'Layout' ),
62         'content' => $help,
63 ) );
64
65 $help  = '<p>' . __( 'The boxes on your Dashboard screen are:' ) . '</p>';
66 if ( current_user_can( 'edit_posts' ) )
67         $help .= '<p>' . __( '<strong>At A Glance</strong> &mdash; Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '</p>';
68         $help .= '<p>' . __( '<strong>Activity</strong> &mdash; Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '</p>';
69 if ( is_blog_admin() && current_user_can( 'edit_posts' ) )
70         $help .= '<p>' . __( "<strong>Quick Draft</strong> &mdash; 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>';
71 if ( ! is_multisite() && current_user_can( 'install_plugins' ) )
72         $help .= '<p>' . __( '<strong>WordPress News</strong> &mdash; Latest news from the official WordPress project, the <a href="https://planet.wordpress.org/">WordPress Planet</a>, and popular and recent plugins.' ) . '</p>';
73 else
74         $help .= '<p>' . __( '<strong>WordPress News</strong> &mdash; Latest news from the official WordPress project, the <a href="https://planet.wordpress.org/">WordPress Planet</a>.' ) . '</p>';
75 if ( current_user_can( 'edit_theme_options' ) )
76         $help .= '<p>' . __( '<strong>Welcome</strong> &mdash; Shows links for some of the most common tasks when setting up a new site.' ) . '</p>';
77
78 $screen->add_help_tab( array(
79         'id'      => 'help-content',
80         'title'   => __( 'Content' ),
81         'content' => $help,
82 ) );
83
84 unset( $help );
85
86 $screen->set_help_sidebar(
87         '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
88         '<p>' . __( '<a href="https://codex.wordpress.org/Dashboard_Screen" target="_blank">Documentation on Dashboard</a>' ) . '</p>' .
89         '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
90 );
91
92 include( ABSPATH . 'wp-admin/admin-header.php' );
93 ?>
94
95 <div class="wrap">
96         <h1><?php echo esc_html( $title ); ?></h1>
97
98 <?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
99         $classes = 'welcome-panel';
100
101         $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
102         // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
103         $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
104         if ( $hide )
105                 $classes .= ' hidden'; ?>
106
107         <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
108                 <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
109                 <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e( 'Dismiss' ); ?></a>
110                 <?php
111                 /**
112                  * Add content to the welcome panel on the admin dashboard.
113                  *
114                  * To remove the default welcome panel, use {@see remove_action()}:
115                  *
116                  *     remove_action( 'welcome_panel', 'wp_welcome_panel' );
117                  *
118                  * @since 3.5.0
119                  */
120                 do_action( 'welcome_panel' );
121                 ?>
122         </div>
123 <?php endif; ?>
124
125         <div id="dashboard-widgets-wrap">
126         <?php wp_dashboard(); ?>
127         </div><!-- dashboard-widgets-wrap -->
128
129 </div><!-- wrap -->
130
131 <?php
132 require( ABSPATH . 'wp-admin/admin-footer.php' );