
前言介紹
- 這款 WordPress 外掛「We The People」是 2013-05-31 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2015-01-25,距離現在已有 3752 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.5.1 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
stevegrunwell | buckeyeinteractive |
外掛標籤
america | petition | democracy | White House | We The People |
內容簡介
2013年5月,白宮釋出We The People的API。此應用程式旨在提供市民與白宮之間的直接聯繫。白宮承諾對跨越特定簽名門檻的請願進行官方公開回應。
此外掛讓WordPress網站擁有者可以從We The People搜尋並嵌入請願至WordPress中。也許您正在撰寫一篇有關請願的意見文章,並希望了解即時的簽名統計和來自白宮的任何回應。或許您是某個特定議題的支持者,想在側邊欄中展示它以幫助宣傳意識。 WordPress的易用性以及We The People控件的完全可自定義模板,讓您有能力分享對您而言重要的事情。
特別鳴謝
特別感謝白宮網站團隊為對外開放We The People API及邀請Buckeye Interactive前來領銜發布此控件。
用法
此外掛包含多種從We The People嵌入請願的方法:
簡碼
最簡單的方法是通過WordPress簡碼開始。其語法如下:[wtp-petition id="123"]。
從We The People網站上發現請願ID不是特別容易,因此We The People外掛包括一个TinyMCE按鈕以幫助您。點擊按鈕將打開一個疊層,讓您通過標題搜索We The People請願,以找到您的議題。您也可以將搜索結果限制為開放的請願。
小部件
要將We The People請願添加到WordPress的動態側邊欄中,請前往「外觀」>「小工具」,並將「WTP Petition」小部件拖入所需的側邊欄中。像TinyMCE按鈕一樣,該小部件允許您通過標題搜索您需要的請願並顯示僅開放的請願。
$GLOBALS[‘we-the-people’]全局變量(進階)
如果您是開發人員,需要更完整地訪問We The People API,您可以使用經由$GLOBALS['we-the-people']全局變量可用的api()方法。api()方法接受兩個參數:要調用的API方法(在版本1.*中為'retrieve'或'index')以及要傳遞給API的參數陣列。
注意:在2.0版本之前,此外掛使用全局$we_the_people變量。如果您對We The People模板進行了自定義,您會希望確認更新此參考。
完整的API文檔在We The People API頁面上可用。更多面向開發人員的文檔可以在此外掛的GitHub存儲庫中找到。
樣式化請願顯示
We The People具有內置的請願模板,但可輕鬆地在您的主題中進行修改。最簡單的方式可能是將templates/wtp-petition.php複製到您的主題中開始,但非常基本的自訂模板可能如下所示:
title; ?>
signaturesNeeded ); ?>
原文外掛簡介
In May 2013 the White House released an API for We The People, a petition application designed to give citizens a direct line to the White House. The White House has committed to issue an official, public response to petitions that cross a particular signature threshold.
This plugin allows WordPress site owners to search and embed petitions from We The People into WordPress. Perhaps you’re writing an opinion piece on a petition and want real-time statistics on signatures and any response from the White House. Maybe you’re a supporter of a particular issue and want to feature it on your sidebar to help promote awareness. The ease of WordPress with the totally customizable templates of the We The People plugin give you the power to share what’s important to you.
Special thanks
Special thanks goes out to the White House web team for building and opening the We The People API for the general public and for inviting Buckeye Interactive to the National Day of Civic Hacking to premiere this plugin.
Usage
The plugin includes a number of different ways to embed petitions from We The People:
Shortcodes
The simplest way to get started is through WordPress shortcodes. The syntax is as easy as: [wtp-petition id="123"].
Petitions IDs aren’t especially easy to uncover from the We The People site so the We The People plugin includes a TinyMCE button to help you. Clicking the button will open an overlay that will let you search the We The People petitions by title to find your issue. You may also limit your search results to open petitions.
Widget
To add a We The People petition to a WordPress dynamic sidebar go to Appearance > Widgets and drag a “WTP Petition” widget into the desired sidebar. Like the TinyMCE button the widget allows you to search for your desired petition by title and show only open petitions.
$GLOBALS[‘we-the-people’] global variable (advanced)
If you’re a developer and need more complete access to the We The People API you can use the api() method available through the $GLOBALS['we-the-people'] global variable. The api() method accepts two arguments: the API method to call (‘retrieve’ or ‘index’ in version 1.*) and an array of arguments to pass to the API.
Note: Before version 2.0, the plugin used a global $we_the_people variable. If you did customizations to We The People templates you’ll want to be sure to update this reference.
Full API documentation is available on the We The People API page. More developer-oriented documentation can be found in this plugin’s GitHub repository.
Styling the petition display
We The People has a built-in petition template but makes it easy to override in your theme. It may be easiest to copy templates/wtp-petition.php into your theme to get started but a very basic custom template might look something like this:
title; ?>
signaturesNeeded ); ?>
We The People uses the following order to determine which template to use when displaying a petition:
Shortcodes:
wtp-petition-{id}.php (child theme)
wtp-petition.php (child theme)
wtp-petition-{id}.php (parent theme)
wtp-petition.php (parent theme)
templates/wtp-petition.php (plugin)
Widgets:
wtp-petition-widget-{id}.php (child theme)
wtp-petition-widget.php (child theme)
wtp-petition-widget-{id}.php (parent theme)
wtp-petition-widget.php (parent theme)
templates/wtp-petition-widget.php (plugin)
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「We The People」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 1.1 |
延伸相關外掛(你可能也想知道)
暫無相關外掛推薦。