35 private $tabs = array();
46 $this->currentScreen = get_current_screen();
59 public function tabs( $tabs = array() )
61 die( __METHOD__ .
' must be override in your subclass' );
72 $this->
tabs = array_merge( $this->
tabs, (array)$this->
tabs() );
75 foreach ( $this->
tabs as $title => $callable_content ) {
76 $this->
addTab( $title, $callable_content );
81 if ( !empty( $sidebar ) ) {
82 $this->currentScreen->set_help_sidebar( $sidebar );
94 public function addTab( $title, $callable_content )
97 if ( empty( $callable_content ) ) {
102 $this->
tabs[$title] = $callable_content;
105 'id' => sanitize_key( $title ),
109 if ( is_string( $callable_content ) && !is_callable( $callable_content ) ) {
110 $help_tab[
'content'] = $callable_content;
113 if ( is_callable( $callable_content ) ) {
114 $help_tab[
'callback'] = $callable_content;
117 $this->currentScreen->add_help_tab( $help_tab );