[WordPress] 外掛分享: Google DocView Link WordPress plugin

首頁外掛目錄 › Google DocView Link WordPress plugin
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
10+
安裝啟用
尚無評分
3495 天前
最後更新
問題解決
WordPress 3.0+ v1.0.2 上架:2012-05-23

內容簡介

Google文件檢視器需要傳遞要顯示的文件的URL,
且該URL必須進行URL編碼。因為手動URL編碼非常麻煩,
且編碼的URL很難閱讀,因此此外掛提供了一種簡單的方法來
生成已經進行URL編碼的URL。

提供了兩個簡短代碼:[gdocview_url]和[gdocview_link]。

[gdocview_url]需要傳遞URL並返回進行URL編碼的URL。

此簡短代碼需要您自行創建HTML “a”標籤,但允許完全彈性地
進行編輯。URL參數可以是完整的URL(以http開頭)或以斜線開頭的本地地址。
如果傳遞了本地URL,則會自動在其前面加上您的WordPress網站URL。

例如:

<a href='[gdocview_url url="http://example.com/my-document.pdf"]'>點擊此處查看</a>;
<a href='[gdocview_url url="/wp-content/uploads/2016/04/my-document.pdf"]'>查看文件</a>;

請注意,您需要將括號包裹的簡短代碼呼叫用單引號而非雙引號括起來,
因為如果簡短代碼呼叫和其內的URL都使用相同的引號,
您的瀏覽器將會混淆。

[gdocview_link]需要傳遞URL和可選的文本標籤,並返回完整的可點擊連接。

與[gdocview_url]一樣,URL可以是完整的URL或以斜線開頭的本地地址。如果未傳遞標籤,
則使用默認標籤“在線上查看”。

例如:

[gdocview_link url="http://example.com/my-document.pdf" label="使用Google檢視器查看"]

要求

PHP 4+
WordPress 3.0+

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Google DocView Link WordPress plugin」→ 直接安裝(推薦)

原文外掛簡介

The Google Document Viewer requires passing the URL of a document to be shown,
and said URL must be URL-encoded. Since it is a pain to URL-encode URLs by hand,
and since encoded URLs are hard to read, this plugin provides an easy way to
generate url-encoded URLS.
Two shortcodes are provided: [gdocview_url] and [gdocview_link].
[gdocview_url] is passed a URL and returns it URL-encoded.
This shortcode requires you to create your own HTML “a”; tag but allows the complete flexibility
to do so however you want. The URL argument may be a full URL (starting with http) or a local URL
starting with a slash. If a local URL is passed, your WordPress site URL is automatically prepended.
Examples:
Click here to view;
See the document;

Note that you need to enclose the bracketed shortcode call in single quotes, not double, because if both the
shortcode call and the URL within it are enclosed in the same type of quotes your browser will be confused.

[gdocview_link] is passed a URL and an optional text label, and returns a full clickable link.
As with [gdocview_url] the URL may be a full URL or a local URL starting with a slash. If no label
is passed, the default label “View Online” is used.
Example:
[gdocview_link url="http://example.com/my-document.pdf" label="View with the Google Viewer"]

Requirements

PHP 4+
WordPress 3.0+

延伸相關外掛

文章
Filter
Apply Filters
Mastodon