標記在我更新帖子時出現。當我第一次發布新帖子時,我無法獲取標簽。首次發布時如何獲取代碼?add_action('save_post', 'bunu_worker', 10, 2);function bunu_worker($ID, $posts) { global $wp,$post; $postge = get_the_tags($ID); $arkadaslar = '[email protected]'; $headers = array('Content-Type: text/html; charset=UTF-8'); wp_mail( $arkadaslar, "subject mesage", print_r($postge, true), $headers , array() ); return;}
1 回答

冉冉說
TA貢獻1877條經驗 獲得超1個贊
add_action ('save_post', 'job_worker', 10, 2);
我無法獲取標記,因為數據庫記錄在進程中處于晚期。
下面的鉤子在數據庫記錄發生后工作,所以我可以獲取標簽。
add_action ('set_object_terms', 'job_worker', 10, 2);
- 1 回答
- 0 關注
- 102 瀏覽
添加回答
舉報
0/150
提交
取消