
內容簡介
WordPress 的 Quip 整合外掛
簡介
WP Quip 外掛使用 WordPress 短代碼 (shortcode) 將 Quip 文件嵌入 WordPress 頁面和文章中。
https://codex.wordpress.org/Shortcode
https://codex.wordpress.org/Shortcode_API
使用方式
要將 Quip 文件的內容嵌入 WordPress 頁面或文章中,使用 ‘quip’ 短代碼。
‘quip’ 短代碼接受兩個屬性並具有以下格式:
[quip id=”mWnnAszre3MW” ttl=7200]
其中,
‘id’(必填)- Quip 文件的 ID(例如https://quip.com/mWnnAszre3MW)
‘ttl’(可選)- 存活時間(秒)。
在第一次請求 Quip API 後,外掛會將文件的內容(HTML 和圖像)緩存指定的時間(秒)。
所有對同一個頁面或文章的後續請求都不會再次調用 Quip API,而是從内部緩存中檢索文件,從而使頁面更快。
在 ‘ttl’ 過期後,外掛會再次調用 Quip API 並重新緩存結果。
如果未提供 ‘ttl’ 屬性,則使用預設值7200 秒(2小時)。
您可以在 ‘Quip 設置’(菜單 ‘设置/WP Quip’)中更改預設值。
如果 ‘ttl’ 設為 ‘0’,外掛將不會緩存響應,每次對 WordPress 頁面或文章的請求都會調用 Quip API。
注意:將 ‘ttl’ 設為 ‘0’ 也會使文件緩存失效。
如果您更改了 Quip 文件並希望立即在網站上反映更改,可以使用此方法。
在這種情況下,請在 Quip 中更新文件,將 ‘quip’ 短代碼中的 ‘ttl’ 設置為 ‘0’,
刷新網頁以使緩存失效,然後將 ‘ttl’ 設置回其原始值。
外掛標籤
開發者團隊
原文外掛簡介
Quip integration for WordPress
Introduction
WP Quip plugin uses WordPress shortcodes to embed Quip documents into WordPress pages and blog posts.
https://codex.wordpress.org/Shortcode
https://codex.wordpress.org/Shortcode_API
Usage
To embed the content of a Quip document into a WordPress page or blog post, use the ‘quip’ shortcode.
‘quip’ shortcode accepts two attributes and has the following format:
[quip id=”mWnnAszre3MW” ttl=7200]
where
‘id’ (Required) – The ID of the Quip document (e.g. https://quip.com/mWnnAszre3MW)
‘ttl’ (Optional) – Time-To-Live in seconds.
After the first request to the Quip API, the plugin caches the content of the document (HTML and images) for the specified amount of time (seconds).
All consecutive requests to the same page or blog post will not call the Quip API again but will retrieve the document from the internal cache, making the pages faster.
After the ‘ttl’ expires, the plugin will call the Quip API and cache the result again.
If the ‘ttl’ attribute is not provided, the default value of 7200 seconds (2 hours) is used.
You can change the default value in ‘Quip Settings’ (menu ‘Settings/WP Quip’).
If ‘ttl’ is set to ‘0’, the plugin will not cache the responses, and every request to the WordPress page or blog post will call the Quip API.
NOTE: Setting ‘ttl’ to ‘0’ also invalidates the document cache.
This could be used if you change the Quip document and want the changes to be reflected on the website immediately.
In this case, update the document in Quip, set ‘ttl’ to ‘0’ in the ‘quip’ shortcode,
refresh the WordPress page or blog post in the browser to invalidate the cache,
and then set ‘ttl’ back to its original value.
