wp_editor와 teeny를 사용하여 내 wp 테마에 대한 사용자 정의 tinymce 막대 단추를 만들고 있지만 문제가 있습니다. hr과 charmap을 추가하면이 버튼들은 주석 막대에 나타나지 않습니다. fify_mce_buttons 필터를 통해 시간 표시 안 함
$settings = array(
'textarea_name' => 'xor_options[' . $editor . ']',
'quicktags' => array('buttons' => 'strong,em,del,ul,ol,li,close'),
'media_buttons' => true,
'wpautop' => false,
'textarea_rows' => 5,
'editor_height' => 200,
'teeny' => true,
'tinymce' => true
);
wp_editor($xor_output, $xor_editor_id, $settings);
가 지금은 조그만 버튼에 대한 필터를 사용하고 있습니다 :
이
은 wp_editor 구성입니다.add_filter('teeny_mce_buttons', 'xor_editor_buttons', 10, 2);
function xor_editor_buttons($buttons, $editor_id) {
if($editor_id != 'footer-editor') return $buttons;
$buttons = array(
'undo',
'redo',
'formatselect',
'bold',
'italic',
'underline',
'strikethrough',
'blockquote',
'bullist',
'numlist',
'outdent',
'indent',
'alignleft',
'alignright',
'aligncenter',
'alignjustify',
'link',
'unlink',
'hr', // not appears!
'charmap', // not appears!
'removeformat',
'fullscreen'
);
return $buttons;
}
내 코드의 오류는 어디에서 발생합니까? 아니면 약간의 버그입니까? 저는 Wordpress 4.9를 사용하고 있습니다. 감사!
내가 거짓 조그만 설정
를 해결했다. 그럼 나는 배열로 tinymce를 설정했다 :
'tinymce' => array(
'toolbar1' => $b,
'toolbar2' => '',
'toolbar3' => '',
)
여기서 $ b는 (포함 된 hr과 charmap) 필요한 모든 버튼이다. 참조 : Wordpress Developers
답변 해 주셔서 감사합니다. 귀하의 솔루션이 작동하는지 모르겠습니다. 나는 다른 방법으로 해결했다. 내 업데이트 된 질문 위를 참조하십시오! –