oembed_request_post_id

過濾鉤子
apply_filters( 'oembed_request_post_id', $post_id, $url )

oembed_request_post_id: 這是一個過濾鉤,允許開發者修改oEmbed請求中使用的文章ID。文章ID用於確定oEmbed請求是哪個文章的。這個鉤子可以用來為oEmbed請求設定一個自定義的文章ID。

此過濾器記錄在wpincludes/class-wp-oembed-controller.php中。

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

常見問題

FAQs
檢視更多 >