[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-admin/ -> index.php (source)

   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  
  19  if ( current_user_can( 'install_plugins' ) ) {
  20      wp_enqueue_script( 'plugin-install' );
  21      wp_enqueue_script( 'updates' );
  22  }
  23  if ( current_user_can( 'upload_files' ) ) {
  24      wp_enqueue_script( 'media-upload' );
  25  }
  26  add_thickbox();
  27  
  28  if ( wp_is_mobile() ) {
  29      wp_enqueue_script( 'jquery-touch-punch' );
  30  }
  31  
  32  $title       = __( 'Dashboard' );
  33  $parent_file = 'index.php';
  34  
  35  $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>';
  36  
  37  $screen = get_current_screen();
  38  
  39  $screen->add_help_tab(
  40      array(
  41          'id'      => 'overview',
  42          'title'   => __( 'Overview' ),
  43          'content' => $help,
  44      )
  45  );
  46  
  47  // Help tabs
  48  
  49  $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>';
  50  $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>';
  51  
  52  $screen->add_help_tab(
  53      array(
  54          'id'      => 'help-navigation',
  55          'title'   => __( 'Navigation' ),
  56          'content' => $help,
  57      )
  58  );
  59  
  60  $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>';
  61  $help .= '<p>' . __( '<strong>Screen Options</strong> &mdash; Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '</p>';
  62  $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>';
  63  $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>';
  64  
  65  $screen->add_help_tab(
  66      array(
  67          'id'      => 'help-layout',
  68          'title'   => __( 'Layout' ),
  69          'content' => $help,
  70      )
  71  );
  72  
  73  $help = '<p>' . __( 'The boxes on your Dashboard screen are:' ) . '</p>';
  74  
  75  if ( current_user_can( 'edit_posts' ) ) {
  76      $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>';
  77  }
  78  
  79  $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>';
  80  
  81  if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) {
  82      $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 3 most recent draft posts you've started." ) . '</p>';
  83  }
  84  
  85  $help .= '<p>' . sprintf(
  86      /* translators: %s: WordPress Planet URL. */
  87      __( '<strong>WordPress Events and News</strong> &mdash; Upcoming events near you as well as the latest news from the official WordPress project and the <a href="%s">WordPress Planet</a>.' ),
  88      __( 'https://planet.wordpress.org/' )
  89  ) . '</p>';
  90  
  91  if ( current_user_can( 'edit_theme_options' ) ) {
  92      $help .= '<p>' . __( '<strong>Welcome</strong> &mdash; Shows links for some of the most common tasks when setting up a new site.' ) . '</p>';
  93  }
  94  
  95  $screen->add_help_tab(
  96      array(
  97          'id'      => 'help-content',
  98          'title'   => __( 'Content' ),
  99          'content' => $help,
 100      )
 101  );
 102  
 103  unset( $help );
 104  
 105  $screen->set_help_sidebar(
 106      '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
 107      '<p>' . __( '<a href="https://wordpress.org/support/article/dashboard-screen/">Documentation on Dashboard</a>' ) . '</p>' .
 108      '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
 109  );
 110  
 111  include ( ABSPATH . 'wp-admin/admin-header.php' );
 112  ?>
 113  
 114  <div class="wrap">
 115      <h1><?php echo esc_html( $title ); ?></h1>
 116  
 117  <?php
 118  if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
 119      $classes = 'welcome-panel';
 120  
 121      $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
 122      // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
 123      $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
 124      if ( $hide ) {
 125          $classes .= ' hidden';
 126      }
 127      ?>
 128  
 129      <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
 130          <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
 131          <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>
 132          <?php
 133          /**
 134           * Add content to the welcome panel on the admin dashboard.
 135           *
 136           * To remove the default welcome panel, use remove_action():
 137           *
 138           *     remove_action( 'welcome_panel', 'wp_welcome_panel' );
 139           *
 140           * @since 3.5.0
 141           */
 142          do_action( 'welcome_panel' );
 143          ?>
 144      </div>
 145  <?php endif; ?>
 146  
 147      <div id="dashboard-widgets-wrap">
 148      <?php wp_dashboard(); ?>
 149      </div><!-- dashboard-widgets-wrap -->
 150  
 151  </div><!-- wrap -->
 152  
 153  <?php
 154  wp_print_community_events_templates();
 155  
 156  require ( ABSPATH . 'wp-admin/admin-footer.php' );


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7