This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

HTML Helpers

Description

This plugin adds simple HTML tag generation API to WordPress, like these examples:
generates and prints <img src="/wp-content/<your-theme>/images/wordpress.png" alt="Wordpress" />.
β€˜my-image’)) ?> generates and returns almost the same tag, just with absolute url, id and alt attributes set manually.
term_id) ?> generates select tag with options taken from WP β€˜category’ taxonomy and sets $term as selected item
rails-like β€œcycle” that returns β€œodd” on first call, β€œeven” on second, β€œodd” on
third call, so on. reset_cycle resets the cycle.
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.

Installation

This section describes how to install the plugin and get it working.

  1. Upload html-helpers directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the β€˜Plugins’ menu in WordPress
  3. Use html-helpers API in your plugins and themes.

OR

  1. Put html-helpers.php to your plugin or theme folder
  2. require it
  3. Use html-helpers API in your plugins and themes.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“HTML Helpers” is open source software. The following people have contributed to this plugin.

Contributors

Translate “HTML Helpers” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

0.2.3

  • Removed unecessary closing tags for img, input
  • _img and img support image names without an extension
  • smarter β€˜alt’ attribute handling for img

0.2.2

  • Fixed endless recursion for img function

0.2.1

  • Added cycle,reset_cycleand_cycle` functions to support rails-style cycles
  • Added β€œmultiple” option support for select tag.

0.2

  • Initial public release