Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#19974 closed enhancement (fixed)

WP_Screen help getter functions missing

Reported by: npetetin's profile npetetin Owned by: nacin's profile nacin
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.3.1
Component: Administration Keywords: has-patch commit
Focuses: Cc:

Description

Please add getter functions in WP_Screen for help tab and sidebar:

public function get_help_tab( $id ) {
	return $this->_help_tabs[ $id ];
}
public function get_help_sidebar() {
	return $this->_help_sidebar;
}

Thanks.

Attachments (2)

19974.wp-screen-getters.diff (1.1 KB) - added by BenChapman 13 years ago.
Added getters to wp-admin/includes/screen.php
19974.diff (4.6 KB) - added by nacin 13 years ago.

Download all attachments as: .zip

Change History (9)

#1 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.4
  • Owner set to nacin
  • Status changed from new to accepted
  • Type changed from feature request to enhancement

@BenChapman
13 years ago

Added getters to wp-admin/includes/screen.php

#2 @nacin
13 years ago

When looking through this, I noticed that $id isn't actually used to key _help_tabs. (Note it's also _help_tabs, not _help_tab.) This is lame and is something we can get away with breaking compatibility on.

Attached, I'm adding get_help_tab(), get_help_tabs(), and get_help_sidebar(), and then using those helper methods elsewhere in the class.

@nacin
13 years ago

#3 @nacin
13 years ago

  • Keywords has-patch commit added

#5 @nacin
13 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In [19944]:

Add WP_Screen methods get_help_tabs(), get_help_tab( $id ), get_help_sidebar(). Store help tabs by tab ID, not numeric key; allows proper removal with remove_help_tab( $id ). props BenChapman, npetetin for initial getter patch. fixes #19974.

#6 @npetetin
13 years ago

Great!
Thanks.

#7 @nacin
13 years ago

In [19950]:

Add an @return. fixes #19974.

Note: See TracTickets for help on using tickets.