I need to add 4 buttons inserting special tags in my WP ckeditor toolbar. 2 years ago I wrote 4 plugins for old good fckeditor and that worked well. But I see now we must write WP plugins for this purpose http://wordpress.ckeditor.com/?page_id=2 Should I write 4 plugins for all buttons or maybe put them all together in one plugin?
Wed, 04/24/2013 - 18:44
#1

I created a single plugin for
I created a single plugin for single button, I see it in wp admin panel but when I activate it the whole ckeditor dissapears((( Here is the plugin.js
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ ( function() { CKEDITOR.plugins.add( 'mypluginru', { init: function( editor ){ editor.addCommand( 'insertRU', { exec : function( editor ) { editor.insertHtml( '[lang_ru]' ); } }); editor.ui.addButton( 'RU', { label: 'Insert RU', command: 'insertRU', icon: this.path + 'plugin.png' } ); } } ); } )();Here is myplugin.php
Here is mypluginru_class.php
<?php class mypluginru { var $version = '1.0'; var $plugin_path =""; function mypluginru() { $this->__construct(); } function __construct() { $siteurl = trailingslashit(get_option('siteurl')); $this->plugin_path = $siteurl .'wp-content/plugins/' . basename(dirname(__FILE__)) .'/'; } function ckeditor_plugin($plugins) { $plugins['mypluginru']=$this->plugin_path.'ckeplugin/'; return $plugins; } function ckeditor_buttons($buttons) { $buttons[]=array('RU'); return $buttons; } } $mypluginru = new mypluginru(); ?>Excuse me for such a long post. Maybe someone will help!
Well, I've done! The image
Well, I've done! The image must be GIF not PNG. And the editor itsef loads very very slow...