前言介紹
- 這款 WordPress 外掛「Macro Expander」是 2007-08-15 上架。 目前已經下架不再更新,不建議安裝使用。
- 目前有 40 個安裝啟用數。
- 上一次更新是 2007-08-16,距離現在已有 6470 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 2.0 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
mahlzeit |
外掛標籤
內容簡介
您可以透過在部落格文章中輸入特殊指令來呼叫巨集:
[[keyword]]
當讀取到這個指令後,會呼叫名為 "macro_keyword" 的 PHP 函式,並且將其輸出插入頁面中。
您也可以向巨集傳遞參數:
[[keyword][param]]
或多個參數:
[[keyword][param1][param2]]
這些參數由 ][ 字元分隔,可以理解為用另一組方括號括住的列表。
此外,這個外掛的 PHP 檔案中有一個範例函式,示範您如何編寫巨集。它被稱為 "[[test]]",並且在「macro_test」函式中予以定義。這個「test」巨集最多可以接受兩個選用的參數。
在 1.1 版中新增功能:如果您想在 RSS 內容中包含巨集,您必須定義第二個名為 "macro_rss_keyword" 的函式。如果沒有這個函式,該巨集將不會被包含在 RSS 輸出中。
已知問題
這是個快速的駭客包,沒有進行全面的測試,但在我看來它似乎很有效。
WordPress 已經在 [[keyword]] 的前後添加了
和
標籤,這個外掛不會將這些標籤移除。您不能在參數中使用 " 和 '(以及可能還有其他一些字元),因為 WordPress 會在外掛有機會解析參數之前,使用大括號引號替換它們。不過,您可以使用空格。
或許可以傳遞一個 $is_rss 參數,而不是使用兩個獨立的函式?
或許可以更改語法為: ?!
關於
版本 1.1(2007 年 6 月 8 日)- 參數分隔符號現在是 ][,而不是 |。新增 macro_rss_* 函式,用於 RSS 內容。
版本 1.0(2007 年 6 月 7 日)- 初始版本
由 Matthijs Hollemans 撰寫
http://www.hollemansproductions.com/wordpress-macro-expander-plugin.html
原文外掛簡介
You invoke a macro by typing a special command in your blog post:
[[keyword]]
Upon reading this command, the PHP function named “macro_keyword” is called and
its output is inserted on the page.
You can also pass a parameter to the macro:
[[keyword][param]]
Or multiple parameters:
[[keyword][param1][param2]]
The parameters are separated by the ][ characters, or rather, you can look at it
as a list of things in brackets surrounded by another pair of brackets.
The PHP file for this plugin has an example function that shows you how to write
macros. It is called “[[test]]” and is defined in the function “macro_test”. The
“test” macro takes up to two parameters, both optional.
New in 1.1: If you want to include the macros in RSS content, you will have to
define a second function named “macro_rss_keyword”. If this function is not
present, the macro will not be included in the RSS output.
Known Issues
This is a quick hack, not extensively tested but it seems to work for me.
WordPress already adds the
and
tags around the [[keyword]] before
the plugin is called — the plugin doesn’t remove those.
You can’t use ” and ‘ (and possibly a handful of other characters) in
parameters because WordPress replaces them with curly quotes before the
plugin has a chance to parse them. You can use spaces, though.
Maybe pass an $is_rss parameter instead of using 2 separate functions?
Maybe change syntax to: ?!
About
Version 1.1 (8 June 2007) – The parameter separator is now ][ instead of |.
Added macro_rss_* functions for the RSS content.
Version 1.0 (7 June 2007) – First version
Written by Matthijs Hollemans
http://www.hollemansproductions.com/wordpress-macro-expander-plugin.html
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Macro Expander」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
暫無相關外掛推薦。