WordPress.org

Make WordPress Core

Changeset 27563


Ignore:
Timestamp:
03/17/2014 07:46:15 PM (7 years ago)
Author:
nacin
Message:

Cap and theme support checks for the welcome panel.

props MikeHansenMe.
fixes #26276.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r27548 r27563  
    11651165        <h4><?php _e( 'More Actions' ); ?></h4>
    11661166        <ul>
    1167             <li><?php printf( '<div class="welcome-icon welcome-widgets-menus">' . __( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ) . '</div>', admin_url( 'widgets.php' ), admin_url( 'nav-menus.php' ) ); ?></li>
     1167        <?php if ( current_theme_supports( 'widgets' ) || current_theme_supports( 'menus' ) ) : ?>
     1168            <li><div class="welcome-icon welcome-widgets-menus"><?php
     1169                if ( current_theme_supports( 'widgets' ) && current_theme_supports( 'menus' ) ) {
     1170                    printf( __( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ),
     1171                        admin_url( 'widgets.php' ), admin_url( 'nav-menus.php' ) );
     1172                } elseif ( current_theme_supports( 'widgets' ) ) {
     1173                    echo '<a href="' . admin_url( 'widgets.php' ) . '">' . __( 'Manage widgets' ) . '</a>';
     1174                } else {
     1175                    echo '<a href="' . admin_url( 'nav-menus.php' ) . '">' . __( 'Manage menus' ) . '</a>';
     1176                }
     1177            ?></div></li>
     1178        <?php endif; ?>
     1179        <?php if ( current_user_can( 'manage_options' ) ) : ?>
    11681180            <li><?php printf( '<a href="%s" class="welcome-icon welcome-comments">' . __( 'Turn comments on or off' ) . '</a>', admin_url( 'options-discussion.php' ) ); ?></li>
     1181        <?php endif; ?>
    11691182            <li><?php printf( '<a href="%s" class="welcome-icon welcome-learn-more">' . __( 'Learn more about getting started' ) . '</a>', __( 'http://codex.wordpress.org/First_Steps_With_WordPress' ) ); ?></li>
    11701183        </ul>
Note: See TracChangeset for help on using the changeset viewer.