[WordPress] 外掛分享: Post Picker for Gravity Forms

首頁外掛目錄 › Post Picker for Gravity Forms
全新外掛
安裝啟用
尚無評分
170 天前
最後更新
問題解決
WordPress 6.0+ PHP 7.4+ v1.0.0 上架:2025-10-27

內容簡介

```html
<ul>
<li>Gravity Forms 的 Post Picker 外掛透過添加一種複雜的自訂欄位類型,與 Gravity Forms 生態系統無縫集成,徹底改變了如何在表單中收集與文章相關的數據。</li>
<li>這個外掛解決了一個常見問題:允許用戶通過表單從您的 WordPress 網站現有內容中進行選擇。不論您需要訪客從文章中選擇、選擇產品、挑選事件或引用任何自訂文章類型的內容,Post Picker for Gravity Forms 都能輕鬆實現。</li>
</ul>

<h4>Post Picker for Gravity Forms 的特色</h4>
<ul>
<li>與基本下拉菜單字段不同,Post Picker for Gravity Forms 自動從 WordPress 數據庫中實際內容填充下拉菜單。這個字段動態載入最多50個您選擇文章類型的文章,按標題字母順序排列,方便選擇。</li>
<li>該外掛通過在內部存儲文章 ID,同時向用戶顯示易讀的文章標題來保持數據完整性。這種方法確保即使文章標題更改,您的表單項目仍然準確而有意義。</li>
</ul>

<h4>Post Picker for Gravity Forms 核心功能</h4>
<ul>
<li>通用文章類型支持 – 可與您網站註冊的所有文章、頁面和自訂文章類型一起工作</li>
<li>智能數據處理 – 存儲文章 ID,但以文章標題顯示,提供更好的用戶體驗</li>
<li>原生 Gravity Forms 集成 – 出現在進階字段部分,與其他專業字段類型並列</li>
<li>增強 UI 兼容 – 完全支持 Gravity Forms 的增強 UI,提供更好的移動體驗</li>
<li>條件邏輯就緒 – 完全支持 Gravity Forms 的條件邏輯功能</li>
<li>合併標籤兼容 – 與所有 Gravity Forms 合併標籤和通知無縫配合</li>
<li>可自定義的占位符 – 設置自定義的占位文本或使用默認的 "請選擇"</li>
<li>內置驗證 – 自動驗證所選文章是否存在並已發布</li>
<li>開發者友好 – 包含用於自訂文章查詢和擴展功能的過濾器</li>
</ul>
```

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Post Picker for Gravity Forms」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Post Picker for Gravity Forms revolutionizes how you collect post-related data in your forms by adding a sophisticated custom field type that seamlessly integrates with the Gravity Forms ecosystem.
This plugin solves a common problem: allowing users to select from existing content on your WordPress site through forms. Whether you need visitors to choose from blog posts, select products, pick events, or reference any custom post type content, Post Picker for Gravity Forms makes it effortless.
What Makes Post Picker for Gravity Forms Special?
Unlike basic dropdown fields that require manual option entry, Post Picker for Gravity Forms automatically populates dropdown menus with real content from your WordPress database. The field dynamically loads up to 50 posts from your chosen post type, displaying them alphabetically by title for easy selection.
The plugin maintains data integrity by storing post IDs internally while displaying human-readable post titles to users. This approach ensures that even if post titles change, your form entries remain accurate and meaningful.
Core Features

Universal Post Type Support – Works with Posts, Pages, and all custom post types registered on your site
Smart Data Handling – Stores post IDs but displays post titles for better user experience
Native Gravity Forms Integration – Appears in the Advanced Fields section alongside other professional field types
Enhanced UI Compatible – Fully supports Gravity Forms’ Enhanced UI for improved mobile experience
Conditional Logic Ready – Complete support for Gravity Forms conditional logic functionality
Merge Tag Compatible – Works seamlessly with all Gravity Forms merge tags and notifications
Customizable Placeholder – Set custom placeholder text or use the default “Please Select”
Validation Built-in – Automatically validates that selected posts exist and are published
Developer Friendly – Includes filters for customizing post queries and extending functionality
Performance Optimized – Efficient database queries with built-in limits and caching considerations

Perfect For These Use Cases

Contact Forms – Let users select which product or service they are contacting you about
Support Ticket Systems – Let users reference specific documentation or FAQ posts
Event Registration Forms – Let attendees select which event they’re registering for
Product Inquiry Forms – Allow customers to ask questions about specific products
Content Voting Systems – Enable users to vote on their favorite blog posts or content
Appointment Booking – Let clients select from available time slots stored as custom posts
Course Registration – Allow students to enroll in specific courses from your course post type
Real Estate Inquiries – Let prospects inquire about specific properties
Job Applications – Allow applicants to apply for specific job openings

Technical Excellence
Post Picker for Gravity Forms is built using the official Gravity Forms Add-On Framework, ensuring maximum compatibility and following WordPress coding standards. The plugin includes comprehensive validation, sanitization, and security measures to protect your site and data.
Developer Features
For developers, the plugin includes the ppfgf_get_posts_args filter, allowing complete customization of the post query. You can modify which posts appear, change ordering, add meta queries, filter by date ranges, or implement any custom logic your project requires.
Developer Information
Post Picker for Gravity Forms is built with developers in mind and includes several hooks and filters for customization.
Available Filters
ppfgf_get_posts_args
The main filter for customizing which posts appear in the dropdown. This filter receives three parameters:

$args (array) – The WP_Query arguments
$post_type (string) – The selected post type
$field (PPFGF_Field) – The field object

Code Examples
Limit to Recent Posts
“php
add_filter( 'ppfgf_get_posts_args', function( $args, $post_type, $field ) {
// Only show posts from last 30 days
$args['date_query'] = array(
array(
'after' => '30 days ago',
),
);
return $args;
}, 10, 3 );

Change Post Ordering
“php
add_filter( 'ppfgf_get_posts_args', function( $args ) {
// Order by date instead of title
$args['orderby'] = 'date';
$args['order'] = 'DESC';
return $args;
} );

Filter by Meta Field
“php
add_filter( 'ppfgf_get_posts_args', function( $args ) {
// Only show featured posts
$args['meta_query'] = array(
array(
'key' => 'featured',
'value' => '1',
'compare' => '='
)
);
return $args;
} );

Increase Post Limit
“php
add_filter( 'ppfgf_get_posts_args', function( $args ) {
// Show up to 100 posts instead of 50
$args['posts_per_page'] = 100;
return $args;
} );

Filter by Category (for Posts)
“php
add_filter( 'ppfgf_get_posts_args', function( $args, $post_type ) {
if ( 'post' === $post_type ) {
// Only show posts from specific category
$args['category_name'] = 'events';
}
return $args;
}, 10, 2 );

Field-Specific Filtering
“php
add_filter( 'ppfgf_get_posts_args', function( $args, $post_type, $field ) {
// Only apply to specific field ID
if ( 5 === $field->id ) {
$args['author'] = 1; // Only posts by user ID 1
}
return $args;
}, 10, 3 );

延伸相關外掛

文章
Filter
Apply Filters
Mastodon