acf_field_wysiwyg::get_toolbars
This function will return an array of toolbars for the WYSIWYG field
Метод класса: acf_field_wysiwyg{}
Хуки из метода
Возвращает
(Массив).
Использование
$acf_field_wysiwyg = new acf_field_wysiwyg(); $acf_field_wysiwyg->get_toolbars();
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field_wysiwyg::get_toolbars() acf field wysiwyg::get toolbars ACF 6.4.2
function get_toolbars() {
// vars
$editor_id = 'acf_content';
$toolbars = array();
// mce buttons (Full)
$mce_buttons = array( 'formatselect', 'bold', 'italic', 'bullist', 'numlist', 'blockquote', 'alignleft', 'aligncenter', 'alignright', 'link', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' );
$mce_buttons_2 = array( 'strikethrough', 'hr', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' );
// mce buttons (Basic)
$teeny_mce_buttons = array( 'bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'fullscreen' );
// Full
$toolbars['Full'] = array(
1 => apply_filters( 'mce_buttons', $mce_buttons, $editor_id ),
2 => apply_filters( 'mce_buttons_2', $mce_buttons_2, $editor_id ),
3 => apply_filters( 'mce_buttons_3', array(), $editor_id ),
4 => apply_filters( 'mce_buttons_4', array(), $editor_id ),
);
// Basic
$toolbars['Basic'] = array(
1 => apply_filters( 'teeny_mce_buttons', $teeny_mce_buttons, $editor_id ),
);
// Filter for 3rd party
$toolbars = apply_filters( 'acf/fields/wysiwyg/toolbars', $toolbars );
// return
return $toolbars;
}