Create a Custom WordPress Plugin From Scratch
This tutorial is from: http://code.tutsplus.com/tutorials/create-a-custom-wordpress-plugin-from-scratch–net-2668
1 Files and folders
WordPress stores its plugins in the wp-content/plugins/ folder. This is the place where we’ll be adding our files as well.
we are going to use two files (one for the main plugin file and one for implementing the administration page) therefore we’ll be putting all our files in a specific folder that we’ll name oscommerce_importer.
2. Creating the plugin file
Now we create our main plugin file. We’ll name it as itoscommerce_importer.php.
Here are two good examples to show how to add buttons to wordpress editor by build wordpress plugins.
WordPress has two different editors: TinyMCE editor(i.e., visual editor) and Text editor(i.e., HTML editor).
Add Buttons to WordPress Text Editor
Here is an example code snippet which adds a button to the WordPress code editor and wraps the selected text using [code][/code] tags.