Recent Posts
Bash | 0 sec ago
None | 2 sec ago
None | 4 sec ago
None | 10 sec ago
None | 13 sec ago
None | 43 sec ago
JavaScript | 45 sec ago
None | 46 sec ago
C++ | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By bmsterling on the 15th of Jun 2008 04:55:39 PM
Download |
Raw |
Embed |
Report
<?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) {
if ( ! $path || ! @is_file($path) )
return '';
$content = '';
$fp = @fopen($path, 'r');
if ( ! $fp )
return '';
return $content;
}
if( isset( $_GET['dorunquicktag'] ) && !empty( $_GET['dorunquicktag'] ) ){
$quicktagsContent = _getFileContents('../../wp-includes/js/quicktags.js');
echo $quicktagsContent,$quickscripts;
}
$blogurl = get_option('wpurl');
$pluginurl = $blogurl . '/wp-content/plugins/' . basename(__FILE__);
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.
Make A New Post