티스토리 뷰

워드프레스에서 add_filter( )와 apply_filter( ) 차이


Filter Hook인 'auth_cookie_expiration'에 대해 검색하다 보니 검색결과로 'apply_filters( 'auth_cookie_expiration', int $length, int $user_id, bool $remember )'를 나왔다. 잉? apply_filter ? add_filter와 apply_filter 차이가 무엇인지 궁금해졌다.


add_filter는 Filter Hook에 사용자 정의 함수를 거는(Hook)[연결하는] 것이고 apply_fitler는 Filter Hook에 이미 걸려 있는 함수를 호출하는 것이다.


참고 자료