HTML标记 em> strong>:输入此按钮将插入的html标记。Only non-empty html tags are allowed.
仅允许使用非空的html标签。
Most valid HTML tags are supported.
支持大多数有效的HTML标记。
If an invalid HTML tag is entered then the button will be ignored.
如果输入了无效的HTML标签,则该按钮将被忽略。 p>
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.
允许列表中的标签。 p>
The currently supported tags are: abbr, acronym, address, article, asside, b,
当前支持的标签是:abbr,首字母缩写词,地址,文章,side,b,
bdi, bdo, blockquote, button, caption, cite, code, del, details, dfn,
bdi,bdo,blockquote,按钮,标题,引用,代码,del,详细信息,dfn,
div, em, footer, h1, h2, h3, h4, h5, h6, header,
div,em,footer,h1,h2,h3,h4,h5,h6,页眉,
i, ins, main, mark, meta, p, pre, q, s, samp, section, small, span,
i,ins,main,mark,meta,p,pre,q,s,samp,section,small,span,
strong, sub, sup, summary, time, u, var, wbr
强,子,sup,摘要,时间,u,var,wbr p>
Attributes: Add attributes to the html tag.
属性 em> strong>:将属性添加到html标记。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.
值,如果您发现导致问题的原因,请打开一个,然后我将查看需要执行的操作。 p>
Other MediumEditor Options: This is a selection of other
其他MediumEditor选项 strong>:这是其他
的选择Core Options available for
核心选项可用于
MediumEditor with the exception of allowBreakInSingleLineInput (see below).
MediumEditor,但 allowBreakInSingleLineInput em> strong>除外(请参见下文)。Please
请
see the MediumEditor documentation for information on each of the other options.
有关其他每个选项的信息,请参见MediumEditor文档。
Selecting
选择
an option will set that option’s value to true, unselecting the value will set it to false.
一个选项会将该选项的值设置为true,取消选择该值会将其设置为false。 p>
allowBreakInSingleLineInput: This is an option added specifically for use with WP.
allowBreakInSingleLineInput: em> strong>:这是专门为WP使用而添加的选项。
If you set disableReturn on then the medium editor acts like a single line input field.
如果将disableReturn设置为on,则媒体编辑器的行为就像单行输入字段。
Setting
设置
allowBreakInSingleLineInput allows editors to manually type in
tags into these
allowBreakInSingleLineInput允许编辑者在这些标签中手动输入
标记
single line fields to create line breaks.
单行字段以创建换行符。 p>
Medium Editor Theme
中型编辑器主题 h3>
MediumEditor fields will use the WordPress theme created specifically for the this plugin unless you change it.
MediumEditor字段将使用专门为此插件创建的WordPress主题,除非您对其进行更改。
You can alter the theme used for all MediumEditor fields, this is not something that you can apply to only
您可以更改用于所有MediumEditor字段的主题,这不是您只能应用于的主题
some fields.
一些领域。
You can change the theme on your site in one of two ways:
您可以通过以下两种方式之一来更改网站上的主题: p>
1) wp-config.php
1)wp-config.php
Add the following code to your wp-cofig.php file
将以下代码添加到您的wp-cofig.php文件中 p>
define('MEDIUM_EDITOR_THEME', 'beagle'); define('MEDIUM_EDITOR_THEME','beagle');
code> pre>
2) filter
2)过滤器
Add the following code to your functions.php file or wherever you would add such a filter
将以下代码添加到您的functions.php文件中,或将添加此类过滤器的任何地方 p>
add_filter('medium-editor-theme', 'my_medium_editor_theme_function'); add_filter('medium-editor-theme','my_medium_editor_theme_function');function my_medium_editor_theme_function($theme) {
函数my_medium_editor_theme_function($ theme){
$theme = 'beagle';
$ theme ='beagle';
return $theme;
返回$ theme;
}
}
code> pre>
Theme name in the above code is one of the following themes currently supported by MediumEditor:
上面的代码中的主题名称是MediumEditor当前支持的以下主题之一:
beagle, bootstrap, default, flat, mani, roman, tim
beagle,bootstrap,default,flat,mani,roman,tim p>
For more information see MediumEditor and
有关更多信息,请参见 MediumEditor 和
MediumButton
MediumButton p>
Custom Editor Styles
自定义编辑器样式 h3>
The styles used in the medium editor for elementa is inherited from WP.
在elementa的媒体编辑器中使用的样式是从WP继承的。
If you want to override these styles
如果要覆盖这些样式
create a file named “medium-editor-syle.css” in your theme folder.
在主题文件夹中创建一个名为“ medium-editor-syle.css”的文件。
If this file exists is will be
如果该文件存在,将是
automatcially enqueued on all pages where ACF fields appear.
自动出现在所有显示ACF字段的页面上。 p>
Add Custom Buttons in Code
在代码中添加自定义按钮 h3>
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.
在“中型编辑器”字段的字段设置中创建自定义按钮时给出的要求。 p>
Hooks
挂钩 strong> p>- acf/medium-editor-field/custom-buttons – filter for every field
- acf / medium-editor-field / custom-buttons strong> –过滤每个字段 li>
- acf/medium-editor-field/custom-buttonsame={$field_name} – filter for specific field based on it’s name
- acf / medium-editor-field / custom-buttons / name = {$ field_name} strong> –根据名称过滤特定字段 li>
- acf/medium-editor-field/custom-buttons/key={$field_key} – filter for specific field based on it’s key
- acf / medium-editor-field / custom-buttons / key = {$ field_key} strong> –根据其关键字过滤特定字段 li>
ol>
Parameters
参数 strong> p>- $buttons – an array of button options
- $ buttons strong> –一系列按钮选项 li>
$field – an array containing all the fields settings for the field being loaded
$ field strong> –包含要加载的字段的所有字段设置的数组 p>// functions.php
// functions.php p>
function my_custom_buttons($buttons, $field) {
function my_custom_buttons($ buttons,$ field){
$buttons[] = array(
$ buttons [] = array(
‘name’ => ‘red’,
‘名称’=>‘红色’,
‘label’ => ‘Red”‘,
‘label’=>‘Red’’,
‘attributes’ => array(
‘attributes’=> array(
‘name’ => ‘style’,
‘名称’=>‘样式’,
‘value’ => ‘color: #F00;’
‘value’=>‘color:#F00;’
)
)
);
);
return $buttons;
返回$ buttons;
}
}
add_filter(‘acf/medium-editor-field/custom-buttons’, ‘my_custom_buttons’, 10, 2);
add_filter('acf / medium-editor-field / custom-buttons','my_custom_buttons',10,2); p>
li>
ol>
Filter Buttons
过滤器按钮 h3>
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.
按钮。 p>
Hooks
挂钩 strong> p>- acf/medium-editor-field/buttons – filter for every field
- acf / medium-editor-field / buttons strong> –过滤每个字段 li>
- acf/medium-editor-field/buttonsame={$field_name} – filter for specific field based on it’s name
- acf / medium-editor-field / buttons / name = {$ field_name} strong> –根据字段名称过滤特定字段 li>
- acf/medium-editor-field/buttons/key={$field_key} – filter for specific field based on it’s key
- acf / medium-editor-field / buttons / key = {$ field_key} strong> –根据其键过滤特定字段 li>
ol>
Parameters
参数 strong> p>- $buttons – an array of button options
- $ buttons strong> –一系列按钮选项 li>
$field – an array containing all the fields settings for the field being loaded
$ field strong> –包含要加载的字段的所有字段设置的数组 p>// functions.php
// functions.php p>
function my_custom_buttons($buttons, $field) {
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’])) {
if(!isset($ buttons [‘underline’])){
$buttons[‘underline’] = ‘underline’;
$ buttons [‘underline’] =‘underline’;
}
}
// unset strikethrough if it is set
//未设置删除线(如果已设置)
if (isset($buttons[‘strikethrough’])) {
if(isset($ buttons [‘strikethrough’])){
unset($buttons[‘strikethrough’]);
unset($ buttons [‘strikethrough’]);
}
}
return $buttons;
返回$ buttons;
}
}
add_filter(‘acf/medium-editor-field/buttons’, ‘my_buttons’, 10, 2);
add_filter('acf / medium-editor-field / buttons,'my_buttons',10,2); p>
li>
ol>