[WordPress] 外掛分享: Post My CF7 Form

WordPress 外掛 Post My CF7 Form 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Post My CF7 Form」是 2016-06-29 上架。
  • 目前有 3000 個安裝啟用數。
  • 上一次更新是 2024-05-02,距離現在已有 367 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.7 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
  • 有 48 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

aurovrata |

外掛標籤

form to post | contact form 7 | contact form 7 module | contact form 7 extension |

內容簡介

這個外掛讓你可以將每個表單欄位映射到一個文章欄位,讓從你的網站提交的表單可以被保存為一篇新文章,你可以在儀表板中管理並在前端顯示。

你可以提交並映射到文章的以下所有欄位:

預設的文章欄位,標題、作者、內容、摘要
特色圖像,你可以提交文件並將其保存為文章附件
元欄位,可以創建無限數量的元欄位
分類法,你可以將選擇/勾選框/單選輸入欄位映射到分類法,外掛將自動填充你的欄位項目
使用新的使用者介面將提交的表單映射到現有的文章類型
新增表單金鑰以識別 CF7 表單,而不是表單 ID,以使開發更具可攜性
此外掛允許你的使用者從單一頁面管理多個草稿提交。
對於具有多個欄位的大型表單,已添加了自動創建功能以進行元欄位映射,詳細說明請參閱安裝說明。
將連結添加到新保存的文章中,以便在確認郵件中使用

這個外掛的 v3.0 版本引入了許多更改,使其他外掛開發人員能夠利用此外掛中可用的功能。如果你是開發人員,請查看已提供充足評論的代碼。

讓 CF7 表單更具可攜性

這個外掛引入了表單金鑰(可在 CF7 管理頁面中進行修改)。每個表單的金鑰是唯一的,允許你通過其金鑰來識別表單,而不是 ID。為什麼這很有價值?ID 因為是 WordPress 安裝中分配的自訂文章 ID 而在一個伺服器與下一個伺服器之間變化,因此你在本機機器上開發表單,然後當你將表單移動到生產伺服器時,發現 ID 不同。為解決這個問題,我們建議你在這個外掛的聯繫表單短碼 [cf7form key="contact-us"] 中使用表單金鑰。不用擔心,你的舊 CF7 簡碼仍然有效,背後我們只是映射金鑰到 ID 並調用常規的 CF7 簡碼。

強大的表單設計

這個外掛現在完全兼容 Smart Grid-Layout Designs for Contact Form 7。CF7 的智能網格允許回應式網格布局設計表單,以及強大的功能,例如使用具有多行輸入的表格結構進行重複欄位輸入、使用多個選項卡輸入進行重複表單段落以及使用切換的可摺疊部分進行可選輸入部分等。此外,該外掛提供了一種模塊化的表單設計方法,可以將現有表單插入為子段落。

Post my CF7 Form 現在可以無縫地將這些複雜的表單設計保存到你的儀表板文章中。

其他兼容的外掛

Contact Form 7 Conditional Fields by Jules Colle.
Contact Form 7 Multi-Step Addon by ThemeREX.
Contact Form Submissions by Jason Green.
Live Preview for Contact Form 7 by Addons for Contact Form 7.
Void Contact Form 7 widget for elementor page builder by voidCoders.
Country & Phone Field Contact Form 7 by Narinder Singh Bisht.
Date Time Picker Field by Carlos Moreira.

欄位篩選器

除了將表單欄位映射到文章欄位之外,你還可以為該特定表單欄位添加自定義篩選器。該篩選器選項允許你自定義填充提交表單後創建的文章,例如,如果表單要求出生日期,你可能想要為年齡創建額外的文章欄位,以便在你的篩選器中過濾日期欄位

原文外掛簡介

This plugin enables the mapping of each form field to a post field. Each forms submitted from your website will then be saved as a new post which you can manage in your dashboard and display on the front end.

You can submit and map to a post all of the following fields,

Default post field, title, author, content, excerpt
featured image, you can submit a file and save it as a post attachment
meta fields, unlimited number of meta-fields can be created
taxonomies, you can map select/checkbox/radio input fields to taxonomies and the plugin will auto-populate your field items.
map your submitted forms to existing post types using the new UI
addition of form key to identify cf7 forms instead of the form id to make development more portable
this plugin allows your users to manage multiple draft submissions from a single page.
for large forms with multiple fields, an auto-create functionality has been added for meta-field mapping. See the installation instruction for details.
add links to newly saved posts into your confirmation mail.

v3.0 of this plugin introduces many changes to enable other plugin developers to leverage the functionality available in this plugin. If you are a developer, please look at the code where ample comments are provided.
Make your CF7 Form more portable
this plugin introduces form keys (which you can modify in the CF7 admin table). Keys are unique for each form, allowing you identify a form my its key rather than an ID. Why is this priceless? IDs changes from one server to the next because they are the custom post ID attributed by the WordPress installation, and therefore you develop your form in a local machine only to find out that the IDs are different when you move your form to your production server. To overcome this problem, we suggest you use a form key along with this plugin’s contact form shortcode, [cf7form key="contact-us"]. Don’t worry your old contact form 7 shortcodes will still work too, behind the scenes we simply map the key to the ID and call the regular contact form 7 shortcode.
Powerful form designs
This plugin is now fully compatible with Smart Grid-Layout Designs for Contact Form 7. The Smart Grid for CF7 allows responsive grid-layout designed forms, as well as powerful features such as repetitive field inputs (using table structures with multiple row inputs), repetitive form sections using multiple tabbed inputs, as well as optional input sections using toggled collapsible sections. Furthermore the plugin offers a modular approach to form design, where existing forms can be inserted as sub-sections.
Post my CF7 Form now saves these complex forms designs seamlessly into your dashboard posts.
Other compatible plugins

Contact Form 7 Conditional Fields By Jules Colle.
Contact Form 7 Multi-Step Addon By ThemeREX.
Contact Form Submissions by Jason Green.
Live Preview for Contact Form 7 by Addons for Contact Form 7.
Void Contact Form 7 widget for elementor page builder by voidCoders.
Country & Phone Field Contact Form 7 by Narinder Singh Bisht.
Date Time Picker Field by Carlos Moreira.

Filters for fields
In addition to mapping your form fields to post fields you are also given a custom filter for that specific form field. The filter option allows you to custom fill the post created for the submitted form, for example if a form requests the date of birth, you may want to create an additional post field for the age, so you can filter the date field in your functions.php file and calculate the age and save it to a custom post meta field. The custom filters are created using the following nomenclature, cf7_2_post_filter--. For example if you have created a custom post type quick-contact, which as a meta field age, you could filter it with,
add_filter('cf7_2_post_filter-quick-contact-age','filter_date_to_age',10,3);
function filter_date_to_age($value, $post_id, $form_data){
//$value is the post field value to return, by default it is empty
//$post_id is the ID of the post to which the form values are being mapped to
// $form_data is the submitted form data as an array of field-name=>value pairs
if(isset($form_data['date-of-birth']){
//calculate the age
$value = ....
}
return $value;
}

Special Fields
Author – unless the user sets the field, the default set in this order: current logged in user else, the recipient of the CF7 form email if such a user exists in the database, else it reverts to the user_id=1 which is the administrator. A filter is also available to set the author.
Featured image/Thumbnail – these will only accept form fields of type file. However, non image files uploaded will not show up as thumbnails in the post edit page.
Title/Content/Excerpt – there are enabled by default, and can be used to map any form fields to them. However, if you wish disable these fields (using the post registration supports array of values), then please use the filter that allows these to be set for your custom post type. (see the filters section for more info)
Pre-fill form fields
Contact Form 7 does not allow you to pre-fill fields before your form is displayed. With this plugin you can do this, you will need to map your form first, and use the filter ‘cf7_2_post_filter_cf7_field_value’ to pre-fill your fields, see the Filter & Actions section for more details.
Contact Form 7 list table
This plugin re-organises the CF7 dashboard list table, using the cf7 custom post list table to permit other developers to easily add custom columns to the list table. You can therefore use WP functionality to customise your table. For example you could view how many submits a form has received.
Other hooks
The plugin has been coded with additional actions and filters to allow you to hook your functionality such as when a form to post mapping is completed. For a list of such hooks, please refer to the Filter & Actions section.
Checkout our other CF7 plugin extensions

CF7 Polylang Module – this plugin allows you to create forms in different languages for a multi-language website. The plugin requires the Polylang plugin to be installed in order to manage translations.

CF7 Multi-slide Module – this plugin allows you to build a multi-step form using a slider. Each slide has cf7 form which are linked together and submitted as a single form.

Post My CF7 Form – this plugin allows you to save you cf7 form to a custom post, map your fields to meta fields or taxonomy. It also allows you to pre-fill fields before your form is displayed.

CF7 Google Map – allows google maps to be inserted into a Contact Form 7. Unlike other plugins, this one allows map settings to be done at the form level, enabling diverse maps to be configured for each forms.

*Smart Grid Layout Design for CF7 – allows responsive grid layout Contact Form 7 form designs, enabling modular designs of complex forms, and rich inter-linking of your CMS data with taxonomy/posts populated dynamic dropdown fields.
Privacy Notices
This plugin, in itself, does not:

track users by stealth;
write any user personal data to the database;
send any data to external servers;
use cookies.

However, be aware that this plugin allows you to map your forms so as to save the data of any submissions made through these forms to the WordPress database. Should any of these mapped forms collect data considered to be private to the user, it will be saved to the database so you should take due diligence to inform your form user and comply with Privacy Data laws.
30. Allow non-admin users to manage mapping options.
Some of the mapping options (eg quick edit of mapped posts) are by default only accessible to admin users. You can modify this using the following hook and returning a WordPress capability for your user’s role:
add-filter('cf7_2_post_mapping_capability', 'c2p_options_allow_editors', 10,1);
function c2p_options_allow_editors($capability){
return 'edit_others_posts'; //any editor role capability
}

Filters & Actions for Developers
The following are hooks primarily aimed at developers. More general hooks and filters are now documented inline in a helper metabox in the mapping edit page.
‘cf7_2_post_filter_taxonomy_registration-{$taxonomy_slug}’
This filter allows you to customise taxonomies arguments before they are registered.
add_filter('cf7_2_post_filter_taxonomy_registration-my_categories','modify_my_categories');
function modify_my_categories($taxonomy_arg){
//$taxonomy_arg is an array containing arguments used to register the custom taxonomy
//modify the values in the array and pass it back
//for example, by default all taxonomies are registered as hierarchical, use this filter to change this.
$taxonomy_arg['hierarchical'] = false;
return $taxonomy_arg;
}

It is possible to pass optional arguments for Metabox callback functions, taxonomy count update, and the taxonomy capabilities. See the WordPress register_taxonomy documentation for more information.
add_filter('cf7_2_post_filter_taxonomy_registration-my_categories','modify_my_categories');
function modify_my_categories($taxonomy_arg){
$args = array(
'meta_box_cb' => 'my_custom_taxonomy_metabox',
'update_count_callback' => 'my_taxonomy_selected',
'capabilities' => array(
'manage_terms' => 'manage_categories'
'edit_terms' => 'manage_categories'
'delete_terms' => 'manage_categories'
'assign_terms' => 'edit_posts'
)
);
return args;
}

‘cf7_2_post_filter_taxonomy_query’
This filter allows you to modify the taxonomy terms query arguments for a form’s dropdown/checkbox/radio list.
add_filter('cf7_2_post_filter_taxonomy_query','custom_dropdown_order',10,3);
function custom_dropdown_order($args, $cf7_post_id, $taxonomy){
if(20 == $cf7_post_id && 'location_categories' == $taxonomy){
//modify the order in which the terms are listed,
$args['order_by'] = 'count';
}
return $args;
}

This function changes the list order, putting the most commonly used terms at the top of the list.
For more information on taxonomy query arguments, please refer to the WP codex documentation.
‘cf7_2_post_filter_cf7_taxonomy_select2’
This filter expects a boolean, by default it is true and enables jQuery select2 plugin on select dropdown fields.
To disable it, do the following
add_filter('cf7_2_post_filter_cf7_taxonomy_select2','disable_select2_plugin',10,3);
function disable_select2_plugin($enable, $cf7_post_id, $form_field){
if(20 == $cf7_post_id && 'your-option' == $form_field){
//we assume here that cf7 form 20 has a dropdown field called 'your-option' which was mapped to a taxonomy
$enable=false;
}
//you could just return false if you want to disable for all dropdown
return $enable;
}

‘cf7_2_post_register_post_{post_type}’
this filter allows you to tweak the arguments used to register the custom_post type, for example, if you want to modify the rewrite front-end slug for the post type,
add_filter('cf7_2_post_register_post_my-custom-post', 'set_rewrite_slug');
function set_rewrite_slug($args){
$args['rewrite'] = array(
'slug' => 'posted-replies',
'with_front' => true
);
return $args;
}

`cf7_2_post_form_posted`
action introduced for plugin developers specifically. Fired at the end of the submission mapping process, once a new post has been created for a new submission. The current mapping of the form fields is exposed, along with the data values submitted in the form and the files uploaded. For developers interested in using this hook, please lookup in the inline documentation in the code itself. The action is located in the includes/class-cf7-2-post-factory.php file.
`cf72post_register_mapped_post`
This action is fired each time the a mapped post is registered with the WP framework. This is mainly added for plugin developers to extend this plugin and target custom post types that are created by this plugin.
add_action(‘cf72post_register_mapped_post’, ‘custom_mapped_post’);
function custom_mapped_post($post_type){
//$post_type the post type being registered in the backend.
}
Contributions
The following have contributed to bug fixes, documentation, and/or translations for this plugin,
@allenchiirogakutetsu
@moikano

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Post My CF7 Form」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.2 | 2.1 | 5.0 | 5.1 | 5.2 | 5.3 | 5.4 | 5.5 | 1.2.1 | 1.2.2 | 1.2.3 | 1.2.4 | 1.2.5 | 1.2.6 | 1.3.0 | 1.3.1 | 1.3.2 | 1.4.0 | 1.5.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.2.0 | 2.2.1 | 2.2.2 | 2.3.0 | 2.4.0 | 2.4.1 | 3.0.0 | 3.1.0 | 3.2.0 | 3.2.1 | 3.3.0 | 3.3.1 | 3.3.3 | 3.4.0 | 3.4.1 | 3.4.2 | 3.4.3 | 3.4.4 | 3.4.5 | 3.4.6 | 3.4.7 | 3.5.0 | 3.6.0 | 3.7.0 | 3.8.0 | 3.8.1 | 3.8.2 | 3.8.3 | 3.8.4 | 3.8.5 | 3.9.0 | 4.0.0 | 4.0.1 | 4.0.2 | 4.0.3 | 4.0.4 | 4.0.5 | 4.1.0 | 4.1.1 | 4.1.2 | 4.1.3 | 4.1.4 | 4.1.5 | 4.1.7 | 4.1.8 | 4.1.9 | 5.6.0 | 5.6.1 | 6.0.0 | 6.0.1 | 6.0.2 | 6.0.3 | 6.0.4 | 6.0.5 | 6.0.6 | 6.0.7 | 6.0.8 | 6.1.0 | trunk | 4.1.10 | 4.1.11 | 4.1.12 |

延伸相關外掛(你可能也想知道)

  • Smart Grid-Layout Design for Contact Form 7 》本外掛使用「smart-grid」CSS 插件建立美觀的表單佈局。它提供了一個圖形編輯器來設計你的表單,以及一個彩色的 HTML 語法編輯器,使用了優秀的 CodeMirror ...。
  • Contact Form 7 Polylang Module 》注意:現在 NOTE v2 是 CF7 Smart Grid-layout 外掛的一個延伸。使用此外掛程式前需先安裝它。為什麼呢?可以閱讀這個主題和這個文章。, 此外插程式可使用 Po...。
  • Contact Form 7 extension for Google Map fields 》此外掛可將 Google 地圖插入到聯絡表單 7 中當作輸入欄,此外掛提供以下功能:, , , 每個表單可設定多個地圖 – 地圖縮放比例和預設位置可在編輯表單頁...。

文章
Filter
Apply Filters
Mastodon