티스토리 뷰
워드프레스에서 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에 이미 걸려 있는 함수를 호출하는 것이다.
참고 자료
- add_filter( string $tag, callable $function_to_add, int $priority = 10, int $accepted_args = 1 )
- apply_filters( string $tag, mixed $value )
- apply_filters( 'auth_cookie_expiration', int $length, int $user_id, bool $remember )
'웹개발 > WordPress' 카테고리의 다른 글
워드프레스 폴더(디렉토리) 구조 (0) | 2017.04.01 |
---|---|
워드프레스 테마 템플릿 계층구조 (0) | 2017.03.29 |
랜딩페이지 만들기 (0) | 2016.01.06 |
워드프레스에서 SMTP 설정하기 (1) | 2016.01.05 |
플러그인 메뉴가 보이지 않는다 (1) | 2016.01.04 |