set_comment_cookies

動作鉤子
do_action( 'set_comment_cookies', $comment, $user, $cookies_consent )
引數
  • (WP_Comment) $comment Comment object.
    Required:
  • (WP_User) $user Comment author's user object. The user may not exist.
    Required:
  • (bool) $cookies_consent Comment author's consent to store cookies.
    Required:
定義位置
相關勾子
sanitize_comment_cookiesget_comment_timeget_comment_idset_logged_in_cookieset_auth_cookie
相關方法
wp_set_comment_cookiessanitize_comment_cookiesget_comment_timeget_comment_idget_comment_classget_comment_count
引入
4.9.6
棄用
-

set_comment_cookies 是一個WordPress函式,在使用者提交評論後為他們設定cookie: 這個函式用來記住使用者的姓名、電子郵件地址和URL,這樣他們在下次評論時就不必重新輸入資訊。

設定評論cookie時執行其他動作。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'set_comment_cookies', $comment, $user, $cookies_consent );
do_action( 'set_comment_cookies', $comment, $user, $cookies_consent );
do_action( 'set_comment_cookies', $comment, $user, $cookies_consent );

常見問題

FAQs
檢視更多 >