[WordPress] 外掛分享: ACF Medium Editor Field

前言介紹

  • 這款 WordPress 外掛「ACF Medium Editor Field」是 2017-01-03 上架。 目前已經下架不再更新,不建議安裝使用。
  • 目前有 4000 個安裝啟用數。
  • 上一次更新是 2022-10-10,距離現在已有 935 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.0.0 以上版本才可以安裝。
  • 有 6 人給過評分。
  • 論壇上目前有 1 個提問,問題解答率 0%

外掛協作開發者

hube2 |

外掛標籤

acf | add on | configurable | medium editor | inline wysywig |

內容簡介

相容性

此 ACF 欄位類型相容於:
* ACF 5
* ACF 6

這是 Advanced Custom Fields (ACF) 5 或 6 的附加外掛程式。如果未安裝且啟用 ACF,則此外掛程式將無法運作。如果重複項欄位不可用,則此外掛程式可能會以有限的能力運作。

有沒有需要給客戶一種編輯文字出現方式的方法,而不希望提供完整的所見即所得 (WYSIWYG) 編輯器?需要介於 WYSYWIG 和文本或文本區域欄位之間的東西,可以根據需要進行配置,以擁有您需要的功能嗎?

此 ACF5 的附加外掛程式將 MediumEditor 作為 ACF 欄位添加。每個欄位實例均可配置,並且每個欄位實例都有其自己的設置。支援 MediumEditor 中的許多選項,包括使用 MediumButton 創建自定義按鈕。使用配置設置或過濾器,也可以更改 MediumEditor 主題。這裡介紹了一些可用選項。要獲取有關 MediumEditor 和 MediumButton 的更多信息,請參閱所提供鏈接中的這些庫的描述

有關詳細信息,請參閱
其他注意事項 和
屏幕截圖

Medium Editor 需要您的幫助!此外掛程式取決於 Medium Editor。這是支持此 ACF 附加外掛程式的 JavaScript 軟件包。我不維護此軟件包。此外掛僅是其 ACF 實現。 Medium Editor 正在尋求貢獻者。如果沒有人維護和改進它,Medium Editor 可能會消失,如果發生這種情況,此外掛程式也不再可能運作。

Github 存儲庫

此外掛程式也在 GitHub 上
https://github.com/Hube2/acf-medium-editor

欄位設置

以下是欄位的解釋,不包括那些應該是自我解釋的欄位。

按鈕:這些是包含在 MediumEditor 中的按鈕。
選擇要在每個編輯器實例中包含的按鈕。

自定義按鈕:這是我建立此外掛程式的主要原因。此欄位支援使用 MediumButton 添加自定義按鈕。
請注意,如果任何主要欄位(名稱、標籤、HTML 標記)為空,則會忽略整個按鈕。

名稱:這是按鈕的名稱,將在實例化 MediumButton 物件時使用。
按鈕名稱必須唯一,且不能與 MediumEditor 中已包含的按鈕之一相同。如果這也包含在內,則與標準按鈕名稱相同的按鈕不會覆蓋該按鈕。我不知道在名稱中使用自定義字符的影響。請報告任何錯誤,我將研究添加用於清理字符或尋找其他解決方案的內容。

標籤:這是將出現在按鈕列中的標籤。此欄位允許 HTML。
請確保它是有效的 HTML (我不驗證您輸入的 HTML)。無效的標記可能導致意料之外的錯誤。

原文外掛簡介

Compatibility
This ACF field type is compatible with:
* ACF 5
* ACF 6
This is an add on plugin for Advanced Custom Fields (ACF) 5 or 6. This plugin will not work if ACF is not installed and active. This plugin may work in a limited capacity if the repeater field is not avilable.
Ever needed to give a client a way to edit the appearence of text without wanting to give them a full blown WYSIWYG editor? Need something less than a WYSYWIG but more than a text or textarea field that you can configure the way you need it to work with the features you need it to have?
This add on for ACF5 adds MediumEditor as an ACF field.
Each field instance is configurable, and each field instance has its own settings. Many of the options
available in MediumEditor are supported, including the creation of custom buttons using MediumButton. It is also possible using either a configuration
setting or a filter to alter the MediumEditor Theme. Some of the available options are covered below.
For more information on MediumEditor and MediumButton, see the description of these libaries at the links provided.
For more information see
Other Notes and
Screenshots
Medium Editor needs your help!. This plugin depends Medium Editor which is the JavaScript package that powers this ACF Add On. I do not maintain this package. This pluig is simply an implementation of it for ACF. Medium Editor is looking for contributors. Without people to help maintain and improve it Medium Editor could fade away and if that happens this plugin will also no longer be possible.
Github Repository
This plugin is also on GitHub
https://github.com/Hube2/acf-medium-editor
Field Settings
The following is an explanation of the fields, not including the ones that should be self explanatory.
Buttons: These are the buttons that are included in MediumEditor.
Select the buttons you want to include in each editor instance.
Custom Buttons: This is the main reason that I created this plugin. This field supports adding
custom buttons using MediumButton.
Please note that if any of the main fields (Name, Label, HTML Tag) are empty that the entire
button will be ignored.
Name: This is then name of the button and will be used when instaniating the MediumButton Object.
The button name must be unique and cannot be one of the buttons already included in MediumEditor, a
button of the same name as one of the standard button in Medium Editor will not override that button
if it is also included. I do not know what the effects of custom characters in the name will be.
Please report any bugs and I will look into adding something to clean up characters or find some other work-around for any that cause errors.
Label: This is the label that will appear in the button bar. This field allows HTML.
Please make sure it is valid html (I do not validate the html you enter). Invalid markup will probably
break the button bar or the entire admin. MediumButton also supports using icons for buttons.
If you want to use icons in your buttons then it is your responsibility to make sure the icon font set is
available for use in the admin of your site.
HTML Tag: Enter the html tag that will be inserted by this button. Only non-empty html tags are allowed.
Most valid HTML tags are supported. If an invalid HTML tag is entered then the button will be ignored.
I’m not sure at this time what effect some of the tags will have in the editor. I haven’t tried them all
if you run into issues let me know and I’ll need to make a decision on wheter to try to fix it or remove
the tag(s) from the allowed list.
The currently supported tags are: abbr, acronym, address, article, asside, b,
bdi, bdo, blockquote, button, caption, cite, code, del, details, dfn,
div, em, footer, h1, h2, h3, h4, h5, h6, header,
i, ins, main, mark, meta, p, pre, q, s, samp, section, small, span,
strong, sub, sup, summary, time, u, var, wbr
Attributes: Add attributes to the html tag. Attibute names must be valid (they must
begin with a letter and contain only letter, numbers, underscores and dashes. Attribute
values must not contain double quotes (“) any attributes that do not conform to these
rules will be ignored. Please note that beyond this, attribute names and values are not
validated. I do not know what effect invalid entries will have on your admin. Like other
values, if you find something that causes an issue, open one and I’ll see what needs to be done.
Other MediumEditor Options: This is a selection of other
Core Options available for
MediumEditor with the exception of allowBreakInSingleLineInput (see below). Please
see the MediumEditor documentation for information on each of the other options. Selecting
an option will set that option’s value to true, unselecting the value will set it to false.
allowBreakInSingleLineInput: This is an option added specifically for use with WP.
If you set disableReturn on then the medium editor acts like a single line input field. Setting
allowBreakInSingleLineInput allows editors to manually type in
tags into these
single line fields to create line breaks.
Medium Editor Theme
MediumEditor fields will use the WordPress theme created specifically for the this plugin unless you change it.
You can alter the theme used for all MediumEditor fields, this is not something that you can apply to only
some fields. You can change the theme on your site in one of two ways:
1) wp-config.php
Add the following code to your wp-cofig.php file
define('MEDIUM_EDITOR_THEME', 'beagle');

2) filter
Add the following code to your functions.php file or wherever you would add such a filter
add_filter('medium-editor-theme', 'my_medium_editor_theme_function');
function my_medium_editor_theme_function($theme) {
$theme = 'beagle';
return $theme;
}

Theme name in the above code is one of the following themes currently supported by MediumEditor:
beagle, bootstrap, default, flat, mani, roman, tim
For more information see MediumEditor and
MediumButton
Custom Editor Styles
The styles used in the medium editor for elementa is inherited from WP. If you want to override these styles
create a file named “medium-editor-syle.css” in your theme folder. If this file exists is will be
automatcially enqueued on all pages where ACF fields appear.
Add Custom Buttons in Code
This filter is applied to the custom buttons before they are validated as having all the correct
requirements that are given when creating a custom button in the field settings for a Medium Editor Field.
Hooks

acf/medium-editor-field/custom-buttons – filter for every field
acf/medium-editor-field/custom-buttons/name={$field_name} – filter for specific field based on it’s name
acf/medium-editor-field/custom-buttons/key={$field_key} – filter for specific field based on it’s key

Parameters

$buttons – an array of button options

$field – an array containing all the fields settings for the field being loaded
// functions.php
function my_custom_buttons($buttons, $field) {
$buttons[] = array(
‘name’ => ‘red’,
‘label’ => ‘Red”‘,
‘attributes’ => array(
‘name’ => ‘style’,
‘value’ => ‘color: #F00;’
)
);
return $buttons;
}
add_filter(‘acf/medium-editor-field/custom-buttons’, ‘my_custom_buttons’, 10, 2);

Filter Buttons
This filter is applied to the list of buttons that will be shown. This list will contain the “name”
of each standard button as well as the “name” of each custom button that has been set up for the field.
Please note that only valid button names can be used here. See medium editor’s list of available
buttons.
Hooks

acf/medium-editor-field/buttons – filter for every field
acf/medium-editor-field/buttons/name={$field_name} – filter for specific field based on it’s name
acf/medium-editor-field/buttons/key={$field_key} – filter for specific field based on it’s key

Parameters

$buttons – an array of button options

$field – an array containing all the fields settings for the field being loaded
// functions.php
function my_custom_buttons($buttons, $field) {
// add underline button to all medium editor fields
// set both the index and the value of the array element
if (!isset($buttons[‘underline’])) {
$buttons[‘underline’] = ‘underline’;
}
// unset strikethrough if it is set
if (isset($buttons[‘strikethrough’])) {
unset($buttons[‘strikethrough’]);
}
return $buttons;
}
add_filter(‘acf/medium-editor-field/buttons’, ‘my_buttons’, 10, 2);

各版本下載點

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

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


2.0.1 | 2.0.2 | 2.1.0 | 2.1.1 | 2.2.0 | 2.2.1 | 2.2.2 | 2.3.0 | 2.3.1 | 2.4.0 | 2.4.1 | 2.4.2 | 2.4.4 | 2.5.0 | 2.5.1 | 2.5.2 | 2.5.3 | 2.6.0 | 2.6.1 | 3.0.0 | trunk |

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

  • 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