wp_welcome_panel

Displays a welcome panel to introduce users to WordPress.

Description

wp_welcome_panel(); 

Usage

  1. if ( !function_exists( 'wp_welcome_panel' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/dashboard.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_welcome_panel(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/dashboard.php  
  1. function wp_welcome_panel() { 
  2. ?> 
  3. <div class="welcome-panel-content"> 
  4. <h2><?php _e( 'Welcome to WordPress!' ); ?></h2> 
  5. <p class="about-description"><?php _e( 'We’ve assembled some links to get you started:' ); ?></p> 
  6. <div class="welcome-panel-column-container"> 
  7. <div class="welcome-panel-column"> 
  8. <?php if ( current_user_can( 'customize' ) ): ?> 
  9. <h3><?php _e( 'Get Started' ); ?></h3> 
  10. <a class="button button-primary button-hero load-customize hide-if-no-customize" href="<?php echo wp_customize_url(); ?>"><?php _e( 'Customize Your Site' ); ?></a> 
  11. <?php endif; ?> 
  12. <a class="button button-primary button-hero hide-if-customize" href="<?php echo admin_url( 'themes.php' ); ?>"><?php _e( 'Customize Your Site' ); ?></a> 
  13. <?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?> 
  14. <p class="hide-if-no-customize"><?php printf( __( 'or, <a href="%s">change your theme completely</a>' ), admin_url( 'themes.php' ) ); ?></p> 
  15. <?php endif; ?> 
  16. </div> 
  17. <div class="welcome-panel-column"> 
  18. <h3><?php _e( 'Next Steps' ); ?></h3> 
  19. <ul> 
  20. <?php if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_for_posts' ) ) : ?> 
  21. <li><?php printf( '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li> 
  22. <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li> 
  23. <?php elseif ( 'page' == get_option( 'show_on_front' ) ) : ?> 
  24. <li><?php printf( '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li> 
  25. <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li> 
  26. <li><?php printf( '<a href="%s" class="welcome-icon welcome-write-blog">' . __( 'Add a blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li> 
  27. <?php else : ?> 
  28. <li><?php printf( '<a href="%s" class="welcome-icon welcome-write-blog">' . __( 'Write your first blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li> 
  29. <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add an About page' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li> 
  30. <?php endif; ?> 
  31. <li><?php printf( '<a href="%s" class="welcome-icon welcome-view-site">' . __( 'View your site' ) . '</a>', home_url( '/' ) ); ?></li> 
  32. </ul> 
  33. </div> 
  34. <div class="welcome-panel-column welcome-panel-last"> 
  35. <h3><?php _e( 'More Actions' ); ?></h3> 
  36. <ul> 
  37. <?php if ( current_theme_supports( 'widgets' ) || current_theme_supports( 'menus' ) ) : ?> 
  38. <li><div class="welcome-icon welcome-widgets-menus"><?php 
  39. if ( current_theme_supports( 'widgets' ) && current_theme_supports( 'menus' ) ) { 
  40. printf( __( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ),  
  41. admin_url( 'widgets.php' ), admin_url( 'nav-menus.php' ) ); 
  42. } elseif ( current_theme_supports( 'widgets' ) ) { 
  43. echo '<a href="' . admin_url( 'widgets.php' ) . '">' . __( 'Manage widgets' ) . '</a>'; 
  44. } else { 
  45. echo '<a href="' . admin_url( 'nav-menus.php' ) . '">' . __( 'Manage menus' ) . '</a>'; 
  46. ?></div></li> 
  47. <?php endif; ?> 
  48. <?php if ( current_user_can( 'manage_options' ) ) : ?> 
  49. <li><?php printf( '<a href="%s" class="welcome-icon welcome-comments">' . __( 'Turn comments on or off' ) . '</a>', admin_url( 'options-discussion.php' ) ); ?></li> 
  50. <?php endif; ?> 
  51. <li><?php printf( '<a href="%s" class="welcome-icon welcome-learn-more">' . __( 'Learn more about getting started' ) . '</a>', __( 'https://codex.wordpress.org/First_Steps_With_WordPress' ) ); ?></li> 
  52. </ul> 
  53. </div> 
  54. </div> 
  55. </div> 
  56. <?php