前言介紹
- 這款 WordPress 外掛「Remote Content Shortcode」是 2014-05-18 上架。 目前已經下架不再更新,不建議安裝使用。
- 目前有 1000 個安裝啟用數。
- 上一次更新是 2019-06-14,距離現在已有 2150 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 2.8 以上版本才可以安裝。
- 有 7 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
http | import | content | web page | shortcode |
內容簡介
使用 [remote_content url="http://www.example.com"] 短碼來使用 cURL 將遠端主機上的內容匯入文章或頁面中。支援 HTML 的 GET 與 POST、BASIC 驗證、HTML 實體編碼、CSS 選擇器和元素刪除、正則表達式取代以及快取。
使用此短碼可以讓您:
在文章中顯示存儲於 Subversion 或 Git 庫中的文件內容,並使用 SyntaxHighlighter 進行格式化。
快速集成來自其他 CMS 系統的內容,例如公司內部網。
使用 WordPress 的權限控制對受保護數據的訪問。
基於 CSS 選擇器(如 jQuery)選擇並刪除 DOM 元素。
基於 PHP 正則表達式查找和替換文本。
對遠端內容進行 HTML 編碼。
從遠程內容中刪除標籤。
暫存遠程內容。
用法
屬性
[remote_content url=”http://www.example.com” method=”GET” timeout=”10″ userpwd=”username:password” htmlentities=”false” strip_tags=”false” decode_atts=”false” selector=”body” remove=”img” find=”~domain.com~” replace=”new-domain.com” cache=”true” cache_ttl=”3600″]
url
您要請求的 URL。
method=[GET| POST ]
HTTP 請求類型,預設為 GET。
params="key=value, foo, bar"
此處列出的鍵將從查詢字符串中解析並附加到 url。用逗號分隔鍵。如果在查詢字符串中找不到值,可以通過在等號後面放置它的默認值來指定: parameter=default。
timeout=[ 0-9...10]
如果不能從快取中獲取,請求超時時間(秒),默認為 10 秒。
userpwd=[**username:password **| post_meta | site_option | constant ]
BASIC 驗證的用戶名和密碼。建議不要直接在標籤中設置用戶名和密碼,因為如果禁用此插件,您的密碼將在網站上公開可見,而應使用其他選項之一。按優先級順序,如果值與帖子 meta_key 匹配,則使用 meta_value,如果匹配 site_option 值,則使用 option_value,如果與常量匹配,則使用常量值,否則按原樣解析字符串數據。格式為 username:password。
htmlentities=[false| true ]
如果要為顯示編碼內容進行 HTML 編碼,設置為 true,默認為 false。
strip_tags=[false| true ]
從響應中剝離所有 HTML 標籤,默認為 false。
decode_atts=[false| true ]
SyntaxHighlighter 插件將 HTML 編碼你的短碼屬性,所以 attr="blah" 變成 attr="blah"。當設置為 true 時,可以修復到預期的值,默認為
原文外掛簡介
Use the [remote_content url="http://www.example.com"] shortcode to import remotely hosted content into your posts or page using cURL. Supports HTML GET and POST, BASIC authentication, HTML entity escaping/encoding, CSS selectors and element removal, regular expression replacements, and caching.
This shortcode will let you…
Display the contents of a document stored in Subversion or Git repository into a post where it can then be formatted using SyntaxHighlighter.
Quickly integrate content from other CMS systems, for example a company intranet.
Control access to protected data using WordPress’ permissions.
Select and remove DOM elements based on CSS selectors (like jQuery).
Find and replace text based on PHP regular expressions.
HTML encode the remote content.
Strip tags from the remote content.
Cache the remote content.
Usage
Attributes
[remote_content url=”http://www.example.com” method=”GET” timeout=”10″ userpwd=”username:password” htmlentities=”false” strip_tags=”false” decode_atts=”false” selector=”body” remove=”img” find=”~domain.com~” replace=”new-domain.com” cache=”true” cache_ttl=”3600″]
url
The url that you want to request.
method=[GET| POST ]
The HTTP request type, defaults to GET.
params="key=value, foo, bar"
The keys listed here will be parsed from the querystring and appended to the url. Separate keys by with commas. If the value is not found in the querystring the default value can be specified by placing it after an equals sign: parameter=default.
timeout=[ 0-9...10]
The request timeout in seconds if it can’t be fetched from the cache, defaults to 10 seconds.
userpwd=[**username:password **| post_meta | site_option | constant ]
The username and password to send for BASIC authentication. It is recommended to not set the username and password directly in the tag, as YOUR PASSWORD WILL BE PUBLICLY VISIBLE ON YOUR WEBSITE IF THIS PLUGIN IS DISABLED, and instead use one of the other options. By order of priority, if the value matches a post meta_key the meta_value is used, if it matches a site_option the option_value is used, and if it matches a constant the constant value is used, otherwise the string data is parsed as is. The format is username:password.
htmlentities=[false| true ]
If you want to HTML encode the content for display, set to true, defaults to false.
strip_tags=[false| true ]
strip all HTML tags from the response, defaults to false.
decode_atts=[false| true ]
The SyntaxHighlighter plugin will HTML encode your shortcode attributes, so attr="blah" becomes attr="blah". This fixes it to the intended value when set to true, defaults to false.
selector=[ CSS Selectors... ]
The CSS selector or comma separated list or selectors for the content you would like to display, for example div.main-content or div.this-class #this-id, defaults to the entire document.
remove=[ CSS Selectors... ]
The CSS selector or comma separated list or selectors for the content that you would like to remove from the content, for example h2.this-class or div#this-id, defaults to no replacement.
find=[ regex ]
Use a PHP regular expression to find content and replace it based on the replace attribute, for example ~http://([^\.]*?)\.example\.com~, defaults to disabled.
replace=[ regex ]
The replacement text to use with the results of the find regular expression, for example https://\\1.new-domain.com, defaults to empty string replacement.
cache=[true| false ]
Set to false to prevent the contents from being cached in the WP-Cache/WordPress transients, defaults to true for performance.
cache_ttl=[ 0-9...3600]
Set the number of seconds to cache the results, using 0 for “as long as possible”, defaults to 3600 seconds (one hour).
Shortcode Contents + POST
If there is any content within the shortcode tags, it is sent as part of the request to the remote server.
[remote_content url="http://www.example.com" method="POST"]
{ json: { example: some_data } }
[/remote_content]
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Remote Content Shortcode」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.3.1 | 1.3.2 | 1.3.3 | 1.4.1 | 1.4.2 | trunk |
延伸相關外掛(你可能也想知道)
One Click Demo Import 》這個外掛的最佳功能在於主題作者可以在他們的主題中定義導入文件,所以所有使用該主題的用戶只需點擊「導入演示數據」按鈕即可。, , 你是主題作者嗎?, 為你...。
Widget Importer & Exporter 》Widget Importer & Exporter 是一個有用的外掛,可將小工具從一個WordPress站點移動到另一個站點,備份小工具,並供主題開發人員為用戶提供範例小工具。...。
Customizer Export/Import 》自訂面板匯出/匯入, 自訂面板匯出/匯入外掛讓您能夠直接從自訂面板界面匯出或匯入您的 WordPress 自訂設定!如果您的佈景主題使用 WordPress 自訂面板進行設...。
Search & Replace 》, 注意:此外掛未進行維護。, , 程式碼會繼續留在 SVN 和 Github 上,如果您有興趣。, 使用「Search & Replace」工具,您可以搜尋任何內容並以其他內容取...。
Import and export users and customers 》在您的免費測試網站中試試看:點擊此處 => https://demo.tastewp.com/import-users-from-csv-with-meta, 一個乾淨易用的用戶和客戶導入/導出外掛,適用於 ...。
Add From Server 》這個外掛提供有限的支援。請不要期望有太多新功能或修正 bug。功能可能隨時被移除。, Add From Server 外掛旨在幫助緩解不好的網站主機所造成的困擾,讓您可...。
Import / Export Customizer Settings 》Astra主題自定義設置提供了多種頭部/腳部佈局、側邊欄和博客設計、顏色、背景、字體等設置。您需要微調這些設置,使您的網站看起來完美無瑕。這些設置可以通...。
WP Import Export Lite 》o.com/goto/wpimportexport" target="_blank">WordPress Import Export 插件 是一款易用、快速且進階的匯入和匯出網站數據的工具。, WordPress Import Export...。
aThemes Starter Sites 》我們擁有豐富且不斷擴展的庫存,裡面裝載著任何種類企業所需的現成模板。, ATHEMES STARTER SITES, 企業業主、自由工作者、網上商店所有者和創意人員:準備好...。
FameTheme Demo Importer 》這款 WordPress 外掛是官方的 FameThemes 主題,一鍵匯入主題的範例內容、小工具與設定。, 如有需要,可以到 https://www.famethemes.com/ 取得免費支援。, ,...。
Rara One Click Demo Import 》您喜歡 Rara Theme 製作的主題展示嗎?還是需要設定主題的指南?, 那麼,您只需要這個外掛!, Rara One Click Demo Import 外掛可以幫助您一鍵匯入演示內容,...。
Media Sync 》您可以掃描所有在uploads目錄中的檔案,並查看哪些檔案實際上在媒體庫中,哪些檔案只是停留在那裡。然後,您可以選擇要將哪些檔案導入數據庫,從而使它們在媒...。
Import Products from any XML, CSV or Excel to WooCommerce 》ouble with special characters., In summary, the WooCommerce add-on for WP All Import is a powerful tool for importing products into your WooCommerc...。
Demo Importer Plus 》Demo Importer Plus 是最佳和強大的演示內容導入外掛之一。它允許您輕鬆地通過單擊一個按鈕來導入演示內容、小工具、定制器設置以及主題設置。, 除此之外,您...。
WP CSV Exporter 》這個外掛程式可以按照每篇文章類型將文章匯出為 CSV 格式。, 此外,它也支援文章的自訂欄位和自訂分類法。, 您還可以設定要下載的文章數量或日期範圍。, 如何...。