2012-05-01 2 views
1

WordPress의 도움말 탭을 제거 할 수있는 방법이 있습니까? 이 탭을 CSS로 숨기지 않기 위해 제거하려고합니다.워드 프레스의 도움말 탭을 제거

wp-admin/includes/screen.php에는 도움말 탭을 제거하기 위해 무언가를 만드는 방법에 대해서는 언급하지 않았지만 몇 줄의 내용이 있습니다.

비슷한 것을 만드는 방법은 add_filter('screen_options_show_screen', '__return_false');이지만 도움말 탭을 제거 하시겠습니까? screen.php 파일에서

는 :

647  /** 
648  * Removes a help tab from the contextual help for the screen. 
649  * 
650  * @since 3.3.0 
651  * 
652  * @param string $id The help tab ID. 
653  */ 
654 public function remove_help_tab($id) { 
655   unset($this->_help_tabs[ $id ]); 
656  } 
657 
658  /** 
659  * Removes all help tabs from the contextual help for the screen. 
660  * 
661  * @since 3.3.0 
662  */ 
663 public function remove_help_tabs() { 
664   $this->_help_tabs = array(); 
665  } 
+0

http://wordpress.stackexchange.com – chrisjlee

답변

2

당신은 contextual_help 도움이 필터를 사용해야합니다.

add_filter('contextual_help', 'wpse50723_remove_help', 999, 3); 
function wpse50723_remove_help($old_help, $screen_id, $screen){ 
    $screen->remove_help_tabs(); 
    return $old_help; 
} 

필터는 이전 컨텍스트 도움말 (3.3 이전) 용 필터입니다. (무엇이 반환되는지는 중요하지 않습니다 ...?).

플러그인은 늦게 (따라서 999) 호출되어야합니다. 플러그인이 자체 도움말 탭을 페이지에 추가 할 수 있기 때문입니다. 이것은 부분적으로 admin_head이 이상적인 고리가되지 않는 이유입니다.

또한이뿐만 아니라

add_action('admin_head', 'mytheme_remove_help_tabs'); 
function mytheme_remove_help_tabs() { 
    $screen = get_current_screen(); 
    $screen->remove_help_tabs(); 
} 

을 작동하지만 첫 번째 옵션은 안전 하나입니다

당신은 시도해야
관련 문제