Hana Code Insert v2.2

v2.2 (10/04/2009) :

1. PHP code content evaluation
Some modification on PHP evaluation that you can use <?php and ?> within the entry content for PHP evaluation.

So, in the previous version, if you wanted PHP code output, you could not use <?php and ?>. But now you can use them inside the entry item.

Previously you could only define PHP codes only.

print "<div style='border:1px dotted red; padding: 5px;'>";
print date("m/d/Y H:i:s");
print "</div>";

But now, below code will work too.

<div style='border:1px dotted red; padding: 5px;'>
<?php print date("m/d/Y H:i:s");?>
</div>

entry_content

2. Custom ShortCode
Also extra feature for custom short code is added. You can define your own custom short code prefix and post fix. So you don’t have to use [hana-code-insert] shortcode any more.

If defined, custom short code format can be used instead of [hana-code-insert name='Entry Name' /]. For example, if you define {{ for start indicator, }} for end indicator, you can use {{Entry Name}}. But beware, your new shortcode format may conflict with other plugins and cause one or more plugins to fail.

There are some restrictions. ^ and \ characters are not allowed. And start and end indicators should not be used part of entry name. HTML comment tag is a good candidate for the customs shortcodes indicators. (Start indicator <!-- , End indicator : -->) In this way, even if the Hana Code Insert is disabled, these shortcodes will not show this way.

Hana Code Insert Admin Setting Screen.
shortcode_setting

Some of the tested custom Short Codes in a post.

===================
[[testing123]]
===================
~~testing123~~
===================
{{testing123}}
===================
This time it uses html comment.
<!-- testing123 -->
===================
 
[ hana-code-insert name='testing123' /]

Below is the output. Note that [hana-code-insert] always works regardless of whether using customs shortcode or not.
shortcode_testing2

I am planning to implement Text Widget Support and enhancement in the Admin settings screen in the next version. (Additional description to recognize code snippet better, Search Fuction, etc..)

Enjoy! Let me know if you experience any problem.

Comments are closed.