Always run the old contextual_help filter. see #18785.

git-svn-id: https://develop.svn.wordpress.org/trunk@19098 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-10-31 21:37:43 +00:00
parent d91bf70dd7
commit 3a15274807
1 changed files with 11 additions and 11 deletions

View File

@ -651,22 +651,22 @@ final class WP_Screen {
// Call old contextual_help_list filter.
self::$_old_compat_help = apply_filters( 'contextual_help_list', self::$_old_compat_help, $this );
if ( isset( self::$_old_compat_help[ $this->id ] ) || empty($this->_help_tabs ) ) {
// Call old contextual_help filter.
if ( isset( self::$_old_compat_help[ $this->id ] ) )
$contextual_help = apply_filters( 'contextual_help', self::$_old_compat_help[ $this->id ], $this->id, $this );
$old_help = isset( self::$_old_compat_help[ $this->id ] ) ? self::$_old_compat_help[ $this->id ] : '';
$old_help = apply_filters( 'contextual_help', $old_help, $this->id, $this );
if ( empty( $contextual_help ) ) {
$default_help = __( '<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>' );
$default_help .= '<br />';
$default_help .= __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' );
$contextual_help = '<p>' . apply_filters( 'default_contextual_help', $default_help ) . '</p>';
}
// Default help only if there is no old-style block of text and no new-style help tabs.
if ( empty( $old_help ) && empty( $this->_help_tabs ) ) {
$default_help = __( '<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>' );
$default_help .= '<br />';
$default_help .= __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' );
$old_help = '<p>' . apply_filters( 'default_contextual_help', $default_help ) . '</p>';
}
if ( $old_help ) {
$this->add_help_tab( array(
'id' => 'contextual-help',
'title' => __('Screen Info'),
'content' => $contextual_help,
'content' => $old_help,
) );
}