원인
주로 빈 배열의 항목 값을 함수의 인자로 전달할 때 발생.
get_post()
함수의 경우 null 값도 인자로 받는다. 덕분에 get_post( $arg[0] )
호출에서 넘겨진 배열이 비었을 경우 계속해서 NOTICE 가 발생한다.
해결책
WP 동작에는 문제없지만 Black-Bar 등으로 디버깅 하는 상태에선 꽤 성가시고 눈에 거슬린다.
해당 하는 부분에서 값 존재 유무를 검사해서 따로 호출하는 방식이 일단 가장 간단하다.
diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php
index e065d60..c3e1012 100644
--- a/wp-includes/capabilities.php
+++ b/wp-includes/capabilities.php
@@ -135,7 +135,7 @@ function map_meta_cap( $cap, $user_id ) {
// edit_others_posts
case 'edit_post':
case 'edit_page':
- $post = get_post( $args[0] );
+ $post = isset($args[0]) ? get_post( $args[0] ) : get_post();
if ( ! $post ) {
$caps[] = 'do_not_allow';
break;