Source View: welcome_panel

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
116      $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
117      // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
118      $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
119      if ( $hide )
120           $classes .= ' hidden'; ?>
121
122       <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
123            <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
124           <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e( 'Dismiss' ); ?></a>
125           <?php do_action( 'welcome_panel' ); ?>
126      </div>
127 <?php endif; ?>
128
129 <div id="dashboard-widgets-wrap">
130
131 <?php wp_dashboard(); ?>
132
133 <div class="clear"></div>
134 </div><!-- dashboard-widgets-wrap -->