Skip to content

Commit

Permalink
add_replace()에서 $args 값을 1로 변경
Browse files Browse the repository at this point in the history
replace hook은 값을 반환해야하므로 항상 최소 1개의 인자를 받아야하지만 기본 값이 0이어서 매번 이를 변경해줘야하는 문제
  • Loading branch information
kkigomi committed Jul 7, 2023
1 parent 4eba618 commit 6e684e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/hook.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function run_event($tag, $arg = ''){
}
}

function add_replace($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=0){
function add_replace($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=1){

if( $hook = get_hook_class() ){
return $hook->addFilter($tag, $func, $priority, $args);
Expand Down Expand Up @@ -130,4 +130,4 @@ function get_hook_datas($type='', $is_callback=''){
}

return null;
}
}

0 comments on commit 6e684e8

Please sign in to comment.