HTML Helpers

This plugin adds simple HTML tag generation API to WordPress.

Author:Nikolay Karev (profile at wordpress.org)
WordPress version required:1.5
WordPress version tested:3.1.4
Plugin version:0.2.3
Added to WordPress repository:15-05-2011
Last updated:16-06-2011
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:http://wordpress.org/extend/plugins/html-help...
Total downloads:1 816
Active installs:10+
plugin download
Click to start download

This plugin adds simple HTML tag generation API to WordPress, like these examples:

<?php img('wordpress'); ?>

generates and prints <img src="/wp-content/<your-theme>/images/wordpress.png" alt="Wordpress" />.

<?php _img('http://example.com/images/wordpress.png', 'alt', array('id' => 'my-image')) ?>

generates and returns almost the same tag, just with absolute url, id and alt attributes set manually.

<?php select('category', collection2options(get_terms('category'), 'term_id', 'name'), $term->term_id) ?>

generates select tag with options taken from WP 'category' taxonomy and sets $term as selected item

<?php cycle(array('odd', 'even')); reset_cycle(); ?>

rails-like "cycle" that returns "odd" on first call, "even" on second, "odd" on third call, so on. reset_cycle resets the cycle.

<?php the_post_meta('meta_name') ?>

shortcut for echo(get_post_meta($id, 'meta_name', true))

Form field generators for text, checkbox, hidden input types, textarea, and more tags. More docs coming soon, you can read the code to figure out other features for now.


ChangeLog