क्या wp_editor()कस्टम लिटिलमेसी बटन के साथ परिभाषित करने का कोई तरीका है ?
मैंने देखा है कि wp_editor फ़ंक्शन संदर्भ में उल्लेख है कि एक $settingsतर्क हो सकता है tinymce (array) (optional) Load TinyMCE, can be used to pass settings directly to TinyMCE using an array()।
मेरा पृष्ठ विभिन्न उदाहरणों का उपयोग करता है और मैं कुछ बटन को कुछ उदाहरणों से जोड़ना चाहूंगा।
उदाहरण के लिए,
Instance #1 : Standard buttons
Instance #2 : bold, italic, ul + (custom) pH, temp
Instance #3 : bold, italic, ul + (custom) min_size, max_size
क्या किसी को पता है कि मैं यह करने के बारे में कैसे जाऊंगा अगर मैंने पहले ही बटन को इस ट्यूटोरियल के अनुसार छोटे-छोटे प्लगइन्स के रूप में पंजीकृत किया है ?
संपादित करें
इस कोड को मैं अपने प्लगइन फाइल में उपयोग कर रहा हूं ताकि यह काम कर सके:
function add_SF_buttons() {
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
return;
if ( get_user_option('rich_editing') == 'true') {
add_filter('mce_external_plugins', 'add_SF_buttons_plugins');
}
}
function add_SF_buttons_plugins($plugin_array) {
$plugin_array['pH'] = $this->plugin_url . '/js/tinymce_buttons/pH.js';
$plugin_array['pH_min'] = $this->plugin_url . '/js/tinymce_buttons/pH_min.js';
$plugin_array['pH_max'] = $this->plugin_url . '/js/tinymce_buttons/pH_max.js';
return $plugin_array;
}
-
if (isset($SpeciesProfile)) {
add_action( 'init' , array (&$SpeciesProfile, 'register_species' ));
add_action( 'init' , array( &$SpeciesProfile, 'register_species_taxonomies' ));
add_action( 'init', array (&$SpeciesProfile, 'add_SF_buttons' ));
}
-
<?php wp_editor( $distribution, 'distribution', array( 'theme_advanced_buttons1' => 'bold, italic, ul, pH, pH_min', "media_buttons" => false, "textarea_rows" => 8, "tabindex" => 4 ) ); ?>
दुर्भाग्य से, यह काम नहीं करता है - उपरोक्त संपादक बस पृष्ठ पर हर दूसरे उदाहरण के समान बटन प्रदर्शित करता है।
अग्रिम में धन्यवाद,