old_slug_redirect_post_id

過濾鉤子
apply_filters( 'old_slug_redirect_post_id', $id )

old_slug_redirect_post_id: 這是一個過濾鉤子,允許開發者修改舊的文章slug重定向中使用的文章ID: 當一個文章的slug被改變時,WordPress會自動將訪問者重定向到該文章的新URL。這個鉤子可以用來為重定向設定一個自定義的文章ID。

過濾舊的slug重定向文章ID。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$id = apply_filters( 'old_slug_redirect_post_id', $id );
$id = apply_filters( 'old_slug_redirect_post_id', $id );
$id = apply_filters( 'old_slug_redirect_post_id', $id );

常見問題

FAQs
檢視更多 >