items_search_form — Return the HTML for an item search form.

Search-related functions

Summary

items_search_form($props = array(), $formActionUri = null, $buttonText = null)

Return the HTML for an item search form.

Parameters:
  • $props (array) – Custom HTML attributes for the form element

  • $formActionUri (string) – URL the form should submit to. If omitted, the form submits to the default items/browse page.

  • $buttonText (string) – Custom text for the form submit button. If omitted, the default text ‘Search for items’ is used.

Returns:

string

Usage

Examples

items_search_form() can be used to include a search form on a page. Use the $props array to set the id or class information for the form element.

<?php echo items_search_form(array('id' => "items-form")); ?>

Use the $buttonText parameter to modify the submit button text.

<?php echo items_search_form(array(), current_url(), "I'm Feeling Lucky"); ?>

See Also