WP_Screen::render_screen_meta() – Render the screen’s help section.

You appear to be a bot. Output may be restricted

Description

Renders the screen's help section.

This will trigger the deprecated filters for backward compatibility.

Usage

WP_Screen::render_screen_meta();

Parameters

Returns

void

Source

File name: wordpress/wp-admin/includes/class-wp-screen.php
Lines:

1 to 100 of 195
  public function render_screen_meta() {

    
/**
 * Filters the legacy contextual help list.
 *
 * @since 2.7.0
 * @deprecated 3.3.0 Use {@see get_current_screen()->add_help_tab()} or
 *                   {@see get_current_screen()->remove_help_tab()} instead.
 *
 * @param array     $old_compat_help Old contextual help.
 * @param WP_Screen $screen          Current WP_Screen instance.
 */
    self::$_old_compat_help = apply_filters_deprecated(
      'contextual_help_list',
      array( self::$_old_compat_help, $this ),
      '3.3.0',
      'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'
    );

    $old_help = isset( self::$_old_compat_help[ $this->id ] ) ? self::$_old_compat_help[ $this->id ] : '';

    
/**
 * Filters the legacy contextual help text.
 *
 * @since 2.7.0
 * @deprecated 3.3.0 Use {@see get_current_screen()->add_help_tab()} or
 *                   {@see get_current_screen()->remove_help_tab()} instead.
 *
 * @param string    $old_help  Help text that appears on the screen.
 * @param string    $screen_id Screen ID.
 * @param WP_Screen $screen    Current WP_Screen instance.
 */
    $old_help = apply_filters_deprecated(
      'contextual_help',
      array( $old_help, $this->id, $this ),
      '3.3.0',
      'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'
    );

    // Default help only if there is no old-style block of text and no new-style help tabs.
    if ( empty( $old_help ) && ! $this->WP_Screen::get_help_tabs() ) {

      
/**
 * Filters the default legacy contextual help text.
 *
 * @since 2.8.0
 * @deprecated 3.3.0 Use {@see get_current_screen()->add_help_tab()} or
 *                   {@see get_current_screen()->remove_help_tab()} instead.
 *
 * @param string $old_help_default Default contextual help text.
 */
      $default_help = apply_filters_deprecated(
        'default_contextual_help',
        array( '' ),
        '3.3.0',
        'get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab()'
      );
      if ( $default_help ) {
        $old_help = '<p>' . $default_help . '</p>';
      }
    }

    if ( $old_help ) {
      $this->WP_Screen::add_help_tab(
        array(
          'id'      => 'old-contextual-help',
          'title'   => __( 'Overview' ),
          'content' => $old_help,
        )
      );
    }

    $help_sidebar = $this->WP_Screen::get_help_sidebar();

    $help_class = 'hidden';
    if ( ! $help_sidebar ) {
      $help_class .= ' no-sidebar';
    }

    // Time to render!
    ?>
		<div id="screen-meta" class="metabox-prefs">

			<div id="contextual-help-wrap" class="<?php echo esc_attr( $help_class ); ?>" tabindex="-1" aria-label="<?php esc_attr_e( 'Contextual Help Tab' ); ?>">
				<div id="contextual-help-back"></div>
				<div id="contextual-help-columns">
					<div class="contextual-help-tabs">
						<ul>
						<?php
            $class = ' class="active"';
            foreach ( $this->WP_Screen::get_help_tabs() as $tab ) :
              $link_id  = "tab-link-{$tab['id']}";
              $panel_id = "tab-panel-{$tab['id']}";
              ?>

							<li id="<?php echo esc_attr( $link_id ); ?>"<?php echo $class; ?>>
								<a href="<?php echo esc_url( "#$panel_id" ); ?>" aria-controls="<?php echo esc_attr( $panel_id ); ?>">
									<?php echo esc_html( $tab['title'] ); ?>
								</a>
							</li>
 

 View on GitHub View on Trac