Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_welcome_panel [ WordPress Function ]

wp_welcome_panel ( No parameters )
Defined at:



Displays a welcome panel to introduce users to WordPress.

Source


<?php
function wp_welcome_panel() {
    global 
$wp_version;

    if ( ! 
current_user_can'edit_theme_options' ) )
        return;

    
$classes 'welcome-panel';

    
$option get_user_metaget_current_user_id(), 'show_welcome_panel'true );
    
// 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
    
$hide == $option || ( == $option && wp_get_current_user()->user_email != get_option'admin_email' ) );
    if ( 
$hide )
        
$classes .= ' hidden';

    list( 
$display_version ) = explode'-'$wp_version );
    
?>
    <div id="welcome-panel" class="<?php echo esc_attr$classes ); ?>">
    <?php wp_nonce_field'welcome-panel-nonce''welcomepanelnonce'false ); ?>
    <a class="welcome-panel-close" href="<?php echo esc_urladmin_url'?welcome=0' ) ); ?>"><?php _e('Dismiss'); ?></a>
    <div class="wp-badge"><?php printf__'Version %s' ), $display_version ); ?></div>

    <div class="welcome-panel-content">
    <h3><?php _e'Welcome to your new WordPress site!' ); ?></h3>
    <p class="about-description"><?php _e'If you need help getting started, check out our documentation on <a href="http://codex.wordpress.org/First_Steps_With_WordPress">First Steps with WordPress</a>. If you&#8217;d rather dive right in, here are a few things most people do first when they set up a new WordPress site. If you need help, use the Help tabs in the upper right corner to get information on how to use your current screen and where to go for more assistance.' ); ?></p>
    <div class="welcome-panel-column-container">
    <div class="welcome-panel-column">
        <h4><span class="icon16 icon-settings"></span> <?php _e'Basic Settings' ); ?></h4>
        <p><?php _e'Here are a few easy things you can do to get your feet wet. Make sure to click Save on each Settings screen.' ); ?></p>
        <ul>
        <li><?php echo sprintf(    __'<a href="%s">Choose your privacy setting</a>' ), esc_urladmin_url('options-privacy.php') ) ); ?></li>
        <li><?php echo sprintf__'<a href="%s">Select your tagline and time zone</a>' ), esc_urladmin_url('options-general.php') ) ); ?></li>
        <li><?php echo sprintf__'<a href="%s">Turn comments on or off</a>' ), esc_urladmin_url('options-discussion.php') ) ); ?></li>
        <li><?php echo sprintf__'<a href="%s">Fill in your profile</a>' ), esc_urladmin_url('profile.php') ) ); ?></li>
        </ul>
    </div>
    <div class="welcome-panel-column">
        <h4><span class="icon16 icon-page"></span> <?php _e'Add Real Content' ); ?></h4>
        <p><?php _e'Check out the sample page & post editors to see how it all works, then delete the default content and write your own!' ); ?></p>
        <ul>
        <li><?php echo sprintf__'View the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ), esc_urlget_permalink) ), esc_urlget_permalink) ) ); ?></li>
        <li><?php echo sprintf__'Delete the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ), esc_urladmin_url('edit.php?post_type=page') ), esc_urladmin_url('edit.php') ) ); ?></li>
        <li><?php echo sprintf__'<a href="%s">Create an About Me page</a>' ), esc_urladmin_url('edit.php?post_type=page') ) ); ?></li>
        <li><?php echo sprintf__'<a href="%s">Write your first post</a>' ), esc_urladmin_url('post-new.php') ) ); ?></li>
        </ul>
    </div>
    <div class="welcome-panel-column welcome-panel-last">
        <h4><span class="icon16 icon-appearance"></span> <?php _e'Customize Your Site' ); ?></h4>
        <?php
        $theme 
wp_get_theme();
        if ( 
$theme->errors() ) :
            echo 
'<p>';
            
printf__'<a href="%s">Install a theme</a> to get started customizing your site.' ), esc_urladmin_url'themes.php' ) ) );
            echo 
'</p>';
        else:
            
$customize_links = array();
            if ( 
'twentyeleven' == $theme->get_stylesheet() )
                
$customize_links[] = sprintf__'<a href="%s">Choose light or dark</a>' ), esc_urladmin_url'themes.php?page=theme_options' ) ) );

            if ( 
current_theme_supports'custom-background' ) )
                
$customize_links[] = sprintf__'<a href="%s">Set a background color</a>' ), esc_urladmin_url'themes.php?page=custom-background' ) ) );

            if ( 
current_theme_supports'custom-header' ) )
                
$customize_links[] = sprintf__'<a href="%s">Select a new header image</a>' ), esc_urladmin_url'themes.php?page=custom-header' ) ) );

            if ( 
current_theme_supports'widgets' ) )
                
$customize_links[] = sprintf__'<a href="%s">Add some widgets</a>' ), esc_urladmin_url'widgets.php' ) ) );

            if ( ! empty( 
$customize_links ) ) {
                echo 
'<p>';
                
printf__'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>. If you stick with %1$s, here are a few ways to make your site look unique.' ), $theme->display('Name'), esc_urladmin_url'themes.php' ) ) );
                echo 
'</p>';
            
?>
            <ul>
                <?php foreach ( $customize_links as $customize_link ) : ?>
                <li><?php echo $customize_link ?></li>
                <?php endforeach; ?>
            </ul>
            <?php
            
} else {
                echo 
'<p>';
                
printf__'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>.' ), $theme->display('Name'), esc_urladmin_url'themes.php' ) ) );
                echo 
'</p>';
            }
        endif; 
?>
    </div>
    </div>
    <p class="welcome-panel-dismiss"><?php printf__'Already know what you&#8217;re doing? <a href="%s">Dismiss this message</a>.' ), esc_urladmin_url'?welcome=0' ) ) ); ?></p>
    </div>
    </div>
    <?php
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics