Posted by bmsterling on Sun 15 Jun 17:55
report abuse | download | new post
- <?php
- /**
- Plugin Name: Quicktag Extender
- Plugin URI:
- Description:
- Author: Benjamin Sterling
- Version: 1.0
- Author URI: http://benjaminsterling.com
- File Name: quicktag-extender.php
- */
- /*
- follow this pattern
- edButtons[edButtons.length] =
- new edButton('ed_h3'
- ,'h3' // human readablel h3 will show on the botton
- ,'<h3>' // open tag
- ,'</h3>' // close tag
- ,'3' // access key
- //, -1 optional, set to -1 if tag does not need to be closed, which mean
- // that you will not need a close tag
- );
- * edit below
- *-----------------------------------------------*/
- $quickscripts = <<<qs
- edButtons[edButtons.length] =
- new edButton('ed_h1'
- ,'h1'
- ,'<h1>'
- ,'</h1>'
- ,'1'
- );
- edButtons[edButtons.length] =
- new edButton('ed_h2'
- ,'h2'
- ,'<h2>'
- ,'</h2>'
- ,'2'
- );
- edButtons[edButtons.length] =
- new edButton('ed_h3'
- ,'h3'
- ,'<h3>'
- ,'</h3>'
- ,'3'
- );
- edButtons[edButtons.length] =
- new edButton('ed_h4'
- ,'h4'
- ,'<h4>'
- ,'</h4>'
- ,'4'
- );
- edButtons[edButtons.length] =
- new edButton('ed_h5'
- ,'h5'
- ,'<h5>'
- ,'</h5>'
- ,'5'
- );
- qs;
- /*
- * end edit
- *--------------------------------------------------*/
- /**
- * Load WP-Config File If This File Is Called Directly
- */
- require_once('../../wp-config.php');
- } // end : if (!function_exists('add_action'))
- // borrowed from tiny_mce_config
- function _getFileContents($path) {
- return '';
- $content = '';
- if ( ! $fp )
- return '';
- return $content;
- }
- $quicktagsContent = _getFileContents('../../wp-includes/js/quicktags.js');
- }
- $blogurl = get_option('wpurl');
- function dome(){
- global $wp_scripts;
- $wp_scripts->scripts['quicktags']->src = '/wp-content/plugins/' . basename(__FILE__) . '?dorunquicktag=true';
- }
- add_action( 'admin_print_scripts', dome);
- ?>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.