[WordPress] 外掛分享: Advanced Custom Fields: Link Picker Field

前言介紹

  • 這款 WordPress 外掛「Advanced Custom Fields: Link Picker Field」是 2015-09-17 上架。
  • 目前有 900 個安裝啟用數。
  • 上一次更新是 2016-12-07,距離現在已有 3070 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.5 以上版本才可以安裝。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

caalami | biostall |

外掛標籤

acf | link picker | link chooser | acf link picker | advanced custom fields |

內容簡介

這個外掛是針對已經廣泛使用的Advanced Custom Fields(高級自訂欄位)外掛的附加外掛,它添加了一種名為「Link Picker」的新欄位類型,允許用戶輸入 URL 或從現有頁面中進行選擇。它是圍繞著所包含的所見即所得欄位編輯器中的連接選擇器形成的一層薄薄的封裝。

這個版本的外掛是從 https://github.com/BIOSTALL/ACF-Link-Picker-Field 所帶有相同名稱的外掛中派生而來的。它的版本在 https://github.com/ahebrank/ACF-Link-Picker-Field 上進行了寄存,問題和 PR 應該在該處提交。

注意:在使用此附加外掛之前,必須安裝Advanced Custom Fields外掛。

相容性

這個 ACF 欄位類型相容於:

ACF 5
ACF 4

ACF 4 的支援已經被棄用,新的外掛功能通常不會與 ACF 4 版本相容。

用法

在前端輸出連接選擇時,您將有三個對象元素可用:

url - 頁面的 URL
title - 所選連結的標題(如果有)
target - 將是空白字符串或 _blank,取決於用戶是否勾選了在新視窗/分頁中打開連結的框框。
postid - 不作為 wp_link 的一部分,這是嘗試查找所選鏈接的文章 ID 的 ajax hack。如果找不到文章 ID,則會返回 0。

代碼示例:

$mylink = get_field('mylink');
var_dump($mylink);

輸出內容為:

array(3) {
["url"]=>
string(31) "http://mysite.com/selected/url/"
["title"]=>
string(10) "Link Title"
["target"]=>
string(6) "_blank"
["postid"]=>
int 2231
}

原文外掛簡介

This add on for the already established Advanced Custom Fields plugin adds a new field type called ‘Link Picker’ which allows the user to enter a URL, or select from the existing pages. It is a thin wrapper around the link selector included with the WYSIWYG field editor.
This plugin is forked from the plugin of the same name hosted at https://github.com/BIOSTALL/ACF-Link-Picker-Field. This version is hosted at https://github.com/ahebrank/ACF-Link-Picker-Field and issues and PRs should be submitted there.
Note: Advanced Custom Fields must be installed for this add-on to work.
Compatibility
This ACF field type is compatible with:

ACF 5
ACF 4

ACF 4 support is deprecated, and new plugin features will generally not work with ACF 4.
Usage
When outputting the link selection on the front end, you will have three object elements available:

url – The URL of the page
title – The title of the link, if entered
target – Will be either a blank string or ‘_blank’, depending on whether the user has ticked the box for the link to open in a new window/tab.
postid – Not available as part of wp_link, this is an ajax hack to attempt to look up the post ID of a selected link. This will return 0 if the post ID was not found.

Code example:
$mylink = get_field('mylink');
var_dump($mylink);

Outputs:
array(3) {
["url"]=>
string(31) "http://mysite.com/selected/url/"
["title"]=>
string(10) "Link Title"
["target"]=>
string(6) "_blank"
["postid"]=>
int 2231
}

各版本下載點

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

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


1.2 | 1.1.0 | 1.1.1 | 1.1.2 | 1.2.1 | 1.2.2 | 1.2.3 | 1.2.5 | 1.2.6 | 1.2.7 | 1.2.8 |

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

  • Advanced Custom Fields (ACF®) 》Advanced Custom Fields 可以讓 WordPress 網站成為一個完整的內容管理系統,提供您所有工具以更好管理您的數據。, 使用 Advanced Custom Fields 外掛,完全...。
  • Advanced Custom Fields: Font Awesome Field 》在 Advanced Custom Fields 中添加一個Font Awesome 圖標字段類型。, , 指定要使用哪些 Font Awesome...。
  • ACF Content Analysis for Yoast SEO 》此外掛確保 Yoast SEO 分析包括所有 ACF 內容,包括彈性內容和重複器。, Yoast SEO for WordPress 內容和 SEO 分析不會考慮一篇文章的Advanced Custom Fields...。
  • Advanced Custom Fields: Extended 》🚀 全方位增強套件,可改進WordPress和Advanced Custom Fields。此外掛旨在提供一個強大的管理框架,涵蓋了眾多改進和優化。, 此外掛需要至少 ACF Pro 5.8。,...。
  • ACF Photo Gallery Field 》t; 'Status', , 'name' => 'status', , 'choices' => array(, 'public' => 'Public', , 'private' => ...。
  • Table Field Add-on for ACF and SCF 》表格欄位外掛程式增強了Advanced Custom Fields外掛程式的功能,讓表格編輯更易於使用。, 此外掛程式需要Advanced Custom Fields外掛程式或專業版!, 表格欄...。
  • Really Simple CSV Importer 》替代 CSV 導入外掛程式。簡單而強大,最適合於技術狂熱者。, , 類別支援, 標籤支援, 自訂欄位支援, Smart Custom Fields 支援, Custom Field Suite 支援, Adv...。
  • ACF to REST API 》此 WordPress 外掛在WordPress REST API中提供了Advanced Custom Fields的端點, 詳細資訊請參閱GitHub:https://github.com/airesvsg/acf-to-rest-api/。
  • ACF Quick Edit Fields 》這個 WordPress 外掛為 Advanced Custom Fields Plugin(Pro 和 Free 5+)增加了快速編輯功能。, 特色, , 在清單檢視中顯示 ACF 欄位值, 支援的 ACF 欄位類型...。
  • Advanced Custom Fields: Gravity Forms Add-on 》提供進階自訂欄位 (Advanced Custom Field),讓 WordPress 編輯使用者或管理員可以在欄位群組配置中選擇 Gravity Form。, 可以在 外掛的 GitHub 存儲庫 中找...。
  • Advanced Custom Fields: Image Aspect Ratio Crop Field 》這是一個進階自訂欄位 (Advanced Custom Fields) 的外掛,會在使用者上傳圖片後強制執行特定的長寬比例或像素大小裁剪。使用長寬比例對於回應式圖片的使用情...。
  • Advanced Custom Fields: Nav Menu Field 》使用 Nav Menu Field 外掛將導覽選單加入Advanced Custom Fields (ACF)。此外掛會在 ACF(版本 5 和 4)加入 Nav Menu 欄位類型,讓您從 WordPress 管理後台...。
  • ACF Theme Code for Advanced Custom Fields 》ACF Theme Code 外掛可以自動生成在主題中實現 Advanced Custom Fields 所需的程式碼。以下是該外掛的功能特色:, , - 縮短網站開發時間。, - 當您發布、編輯...。
  • ACF qTranslate 》此外掛提供 qTranslate-X 相容的 ACF4 和 ACF5PRO 欄位類型,包括文字、文字區域、所見即所得編輯器、影像和檔案。新增欄位至群組時,這些新的欄位類型將在欄...。
  • ACF Options For Polylang 》您使用了高級自訂欄位來建立選項頁面,並且安裝了 Polylang 外掛以獲得令人驚嘆的多語言網站嗎?, 可惜的是,Polylang 並不處理 ACF 的選項頁面。這意味著您...。

文章
Filter
Apply Filters
Mastodon