Add Buttons to your wordpress Editor

Today I worked with adding a button on simple editor of wordpress which will take your input using javascript prompt function, process it and then add it to the editor itself. While searching in net, I got it working very cool. All you have to do is run a javascript query which will do some DOM operation on wordpresse’s admin section. This one helped a lot, I just simplified it in my code below

add_action('admin_footer', 'wpaq_addsome');

function wpaq_addsome(){

		echo <<<EOT
				<script type="text/javascript">
						if(wpaqToolbar = document.getElementById("ed_toolbar")){
							var wpaqNr, wpaqBut, wpaqStart, wpaqEnd;
			echo <<<EOT
							wpaqNr = edButtons.length;
							edButtons[wpaqNr] = new edButton('ed_wpaqNew','New','', '','');
							var wpaqBut = wpaqToolbar.lastChild;
							while (wpaqBut.nodeType != 1){
								wpaqBut = wpaqBut.previousSibling;
							wpaqBut = wpaqBut.cloneNode(true);
							wpaqBut.value = 'Add some Value';
							wpaqBut.title = wpaqNr;
							wpaqBut.onclick = someFunction; = "ed_wpaqFlake";

	function someFunction() {
	myField = document.getElementById('content');
	var myValue = prompt('Enter the value:', '');
	if (myValue) {
		edInsertContent(myField, myValue);


  1. As far as I know Rahat Ayub is doing that. I am not localizing wordpress. There is another project running on where people are localizing wordpress into bangla.

  2. Don’t you think Rahat is one of the talkers who likes to talk. If you look into the past, Rahat has started *many* projects and none of them are finished so far.

    If you want to localize FireFox, you can start working on that. Not as a Meghdoot guy, you can do it directly from WordPress’ site.

  3. “you can do it directly from WordPress’ site.”


    এই .PO ফাইলটার ব্যাপারে বুঝলামনা । ওয়ার্ডপ্রেস , পিএচপি বিবি এগুলা হইতেছে ওয়েব এ্যাপলিকেশন । যেমন পিএচপি বিবি বাংলা করা যায় .PHP ল্যঙ্গুইজ ফাইলে র
    থেকে । কিন্তু এই পো র ব্যাপারে কনফিউজ আমি । আমার ওয়ার্ডপ্রেস হোমসার্ভারে ইন্সটল করা আছে । এখন আমি কিভাবে সেই po ফাইলটা দিয়ে এটারে বাংলায় বানাবো ? কিলিয়ার করেন

Leave a comment

Your email address will not be published. Required fields are marked *