前言介紹
- 這款 WordPress 外掛「Gravity Forms: Post Updates」是 2014-05-16 上架。
- 目前有 400 個安裝啟用數。
- 上一次更新是 2015-07-02,距離現在已有 3593 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.6.1 以上版本才可以安裝。
- 有 13 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
ekaj | jcow | jr00ck | p51labs |
外掛標籤
Frontend | front end | update posts | gravity forms |
內容簡介
需要 PHP 5.3 或更高版本
允許您在前端使用 Gravity Forms 更新任何文章。如果使用 "Gravity Forms + Custom Post Type" 外掛,甚至可以更新自定義文章類型和使用自定義分類法。
功能
支援現有項目的自定義欄位檔案上傳和刪除,並提供縮略圖或 MIME 類型圖示。
修正了多重選擇和複選框上的問題。
修正了分類方面的錯誤。
完全刪除了刪除文章的功能。
現在提供了一些自定義篩選器。
新增了非查詢變數模板方法來設置表單。
新增了一個非常基本的捷徑(更新:雖然此方法仍有支援,但使用 gravityform 捷徑加入 "update" 屬性會更好)。
追加了一個額外的屬性到 gravityform 捷徑: "update"
簡碼
[gravityform id="1" update] // 載入目前文章進行編輯
[gravityform id="1" update="34"] // 載入 ID = 34 的文章進行編輯
我們與 Gravity Forms 的製作者 Rocketgenius 合作增加了一個小升級,使我們可以擴展其簡碼,因此現在您可以僅需將 "update" 屬性添加到普通的 "gravityform" 簡碼中即可。如果只添加 "update",則會載入目前的文章進行更新。如果在更新屬性中添加一個整數,則會使用該 ID 載入文章。
URL 查詢變數
原理上與之前相似,但現在需要一個一次性使用代幣 (Nonce) 才能啟用。
因此,您應該使用動作 (Action) 來建立您的連結。
do_action('gform_update_post/edit_link');
do_action('gform_update_post/edit_link', array(
'post_id' => $post->ID,
'url' => home_url('/edit_post/'),
) );
引數 (查詢變數或陣列)
post_id (int) (選填) 您要編輯的文章 ID。預設:global $post->ID
url (string|int) (選填) 編輯表單所在頁面的完整 URL,或編輯表單所在頁面或文章的 ID。預設:get_permalink()
text (string) (選填) 連結文字。預設:“編輯文章”
title (string) (選填) 錨點標籤的標題屬性。預設:(text) 參數
只取得 URL
這將會返回一個基本的編輯 URL。
apply_filters('gform_update_post/edit_url', '');
指定要編輯的文章 (post_id) 和包含編輯表單的文章 (url)
apply_filters('gform_update_post/edit_url', 1, home_url('/edit_post/'));
捷徑以顯示編輯連結
[gform_update_post_edit_link]
指定要編輯的文章 (post_id) 和包含編輯表單的文章 (url)
[gform_update_post_edit_link post_id=1 url=6]
在範本中
您可以使用動作來強制表單顯示特定的文章:
do_action('gform_update_post/setup_form');
do_action('gform_update_post/setup_form', $post->ID);
do_action('gform_update_post/setup_form', array('post_id' => $post->ID, 'form_id' => $form_id));
參數
post_id (int|array) (選填) 要編輯的文章 ID 或帶有文章 ID 和/或表單 ID 的陣列。這使您可以指定表單 ID,以便不讓更新功能影響其他地方。
原文外掛簡介
Requires PHP 5.3 or greater
Allows you to use Gravity Forms to update any post on the front end. If you use the “Gravity Forms + Custom Post Types”, you can even update custom post types and use custom taxonomies.
Features
Supports custom field file uploading and deletion with thumbnails or mime type icons for existing items.
Fixed a bugs on multi selects and checkboxes.
Fixed bug on Categories.
Completely removed the ability to delete posts.
There are some filters to customize things now.
Adds non-query-var template method to setup a form.
Adds a really basic shortcode to setup a form (UPDATE: This is still supported, but it is better to use the addition, below, to the gravityform shortcode).
Adds an additional attribute to the gravityform shortcode: “update”
SHORTCODE
[gravityform id="1" update] // Loads current post for editing
[gravityform id="1" update="34"] // Loads post where ID=34 for editing
We worked with Rocketgenius, makers of Gravity Forms, to get a small upgrade added that allows us to extend their shortcode, so now you can simply add the “update” attribute to the normal “gravityform” shortcode. If you only add “update”, it will load the current post in to update. If you add an integer to the update attribute, it will use that to load a post by its ID.
URL QUERY VARIABLE
At the heart, it is pretty similar to how it was, but now there is a nonce required to activate it.
So you should use the action to create your links.
do_action(‘gform_update_post/edit_link’);
do_action(‘gform_update_post/edit_link’, array(
‘post_id’ => $post->ID,
‘url’ => home_url(‘/edit_post/’),
) );
Arguments (query string or array)
post_id (int) (optional) The id of the post you want to edit. Default: global $post->ID
url (string|int) (optional) Either the full url of the page where your edit form resides, or an id for the page/post where the edit form resides. Default: get_permalink()
text (string) (optional) The link text. Default: “Edit Post”
title (string) (optional) The title attribute of the anchor tag. Default: (text) parameter
Get just the URL
This will return a basic edit url
apply_filters('gform_update_post/edit_url', '');
Specify post to edit (post_id) and post that holds the edit form (url)
apply_filters('gform_update_post/edit_url', 1, home_url('/edit_post/'));
Shortcode to show the edit link
[gform_update_post_edit_link]
Specify post to edit (post_id) and post that holds the edit form (url)
[gform_update_post_edit_link post_id=1 url=6]
IN TEMPLATE
You can use the action to force a form show a specific post:
do_action('gform_update_post/setup_form');
do_action('gform_update_post/setup_form', $post->ID);
do_action('gform_update_post/setup_form', array('post_id' => $post->ID, 'form_id' => $form_id));
Parameters
post_id (int|array) (optional) The id of the post you want to edit or an array with post id and/or form id. This allows you to specify the form id, so that update functionality does not get applied to other forms on the page. Default: global $post->ID
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Gravity Forms: Post Updates」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.2 | 1.2.4 | 1.2.5 | 1.2.6 | 1.2.7 | 1.2.8 | 1.2.9 | trunk | 1.2.10 | 1.2.11 | 1.2.13 | 1.2.14 | 1.2.16 | 1.2.17 | 1.2.18 | 1.2.20 | 1.2.22 | 1.2.23 |
延伸相關外掛(你可能也想知道)
Prevent Browser Caching 》您是一位前端開發人員嗎?想要清除所有使用者的瀏覽器快取嗎?只需啟用此外掛程式並展現您的作品!, Prevent Browser Caching 外掛程式可讓您自動或手動一鍵...。
My WP Customize Admin/Frontend 》這個外掛讓管理者和前端使用者都能輕鬆地進行自訂設定。許多自訂篩選器和操作,還包含開發者工具。, 示範網站在這裡:https://tastewp.com/new/?pre-installe...。
UsersWP – ReCaptcha 》UsersWP 的 ReCaptcha 外掛程式。, UsersWP ReCaptcha 外掛允許您將高級安全性驗證碼 (captcha) 嵌入表格,如註冊、登入表單中。, 使用 UsersWP Re-Captcha ...。
Social Articles 》使用 Social Articles 您可以從您的 BuddyPress 個人資料建立文章,附加精選圖片、設置類別和標籤等等!, 它支援所有 BuddyPress 主題,因此您不必成為專家就...。
Hide Title 》這個外掛允許管理員在單頁或文章上隱藏標題標籤。。
Frontier Post 》WordPress Frontier Post 插件可讓所有使用者角色在前端輕鬆地管理標準文章。, Frontier Post 插件的目的是為您的部落格啟用前端發布和編輯功能,讓您的用戶...。
Frontend Checklist 》中文:, 使用 Frontend Checklist,你可以為你的訪客創建 HTML 或 PDF 檢查清單。 HTML 檢查清單的狀態可以通過 Cookie 或數據庫保存。你的訪客可以隨時回來...。
Archive Posts Sort Customize 》本外掛可輕鬆設置首頁、日期文章存檔、分類/標籤/分類法文章存檔和搜尋區的介面和可用排序。, 排序項目, , 文章日期, 文章標題, 文章作者, 文章評論數, 文章 ...。
Checklist 》將您網誌上的任何列表轉換成美觀的互動檢查清單。列印、使用、分享、下載到行動裝置等等,全部百分百免費。, 人們喜歡清單!如果您經營一個成功的部落格,您...。
Tailor Page Builder 》Tailor 是一個為 WordPress 設計的免費前端頁面建構器,具備簡單直覺的拖放介面。, , , 請查看 Advanced Features 擴充套件 以了解新的元素和特色。與 Tailor...。
Media Playback Speed 》這個簡短、實用的外掛程式會為使用 mediaelement.js 內建 WordPress 短碼所加入的音訊、影片和播放清單元素添加播放按鈕。, 每組按鈕都針對頁面上的相應元素...。
Forge – Front-End Page Builder 》WordPress Page Builder Plugin, 製作精彩內容不應該困難。這就是為什麼我們創造了Forge,一個前端頁面建構器,讓您可以輕鬆地創建令人驚嘆的網站。, Forge讓...。
Disable Version Caching – Khanakia 》你是一位前端開發者嗎?你想為所有使用者清除瀏覽器快取嗎?只需啟用這個外掛就可以!, Disable Version Caching 可以自動或手動一鍵更新所有 CSS 和 JS 檔案...。
DJD Site Post 》此外掛可在網站中添加(響應式)表單以撰寫文章,而不需要進入管理區。它允許使用「匿名」或「訪客」發布(未登錄用戶)。這使得 DJD Site Post 成為用戶生成...。
Advanced Settings 3 》這是一個非常重要的 WordPress 外掛。, 新增功能, , 新增管理頁面:Scripts, 新增管理頁面:Styles, 從