WordPress.org

Make WordPress Core

Changeset 19098


Ignore:
Timestamp:
10/31/2011 09:37:43 PM (9 years ago)
Author:
nacin
Message:

Always run the old contextual_help filter. see #18785.

File:
1 edited

Legend:

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

    r19097 r19098  
    652652        self::$_old_compat_help = apply_filters( 'contextual_help_list', self::$_old_compat_help, $this );
    653653
    654         if ( isset( self::$_old_compat_help[ $this->id ] ) || empty($this->_help_tabs ) ) {
    655             // Call old contextual_help filter.
    656             if ( isset( self::$_old_compat_help[ $this->id ] ) )
    657                 $contextual_help = apply_filters( 'contextual_help', self::$_old_compat_help[ $this->id ], $this->id, $this );
    658 
    659             if ( empty( $contextual_help ) ) {
    660                 $default_help = __( '<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>' );
    661                 $default_help .= '<br />';
    662                 $default_help .= __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' );
    663                 $contextual_help = '<p>' . apply_filters( 'default_contextual_help', $default_help ) . '</p>';
    664             }
    665 
     654        $old_help = isset( self::$_old_compat_help[ $this->id ] ) ? self::$_old_compat_help[ $this->id ] : '';
     655        $old_help = apply_filters( 'contextual_help', $old_help, $this->id, $this );
     656
     657        // Default help only if there is no old-style block of text and no new-style help tabs.
     658        if ( empty( $old_help ) && empty( $this->_help_tabs ) ) {
     659            $default_help = __( '<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>' );
     660            $default_help .= '<br />';
     661            $default_help .= __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' );
     662            $old_help = '<p>' . apply_filters( 'default_contextual_help', $default_help ) . '</p>';
     663        }
     664
     665        if ( $old_help ) {
    666666            $this->add_help_tab( array(
    667667                'id'      => 'contextual-help',
    668668                'title'   => __('Screen Info'),
    669                 'content' => $contextual_help,
     669                'content' => $old_help,
    670670            ) );
    671671        }
Note: See TracChangeset for help on using the changeset viewer.