Wordless
Stop writing themes like it's 1998.
Public Member Functions | List of all members
TagHelper Class Reference

Public Member Functions

 content_tag ($name, $content, $options=NULL, $escape=false)
 Generates an arbitrary HTML tag. More...
 
 option_tag ($text, $name, $value, $selected=NULL)
 Generates an <option> HTML tag. More...
 
 link_to ($text='', $link=NULL, $attributes=NULL)
 Generates an anchor. More...
 
 content_type_meta_tag ($content=NULL)
 Generates a <meta> tag for content type. More...
 
 title_tag ($title=NULL, $attributes=array())
 Generates the <title> html tag. More...
 
 pingback_link_tag ($url=NULL)
 Generates a <link> tag for the pingback url. More...
 

Member Function Documentation

◆ content_tag()

TagHelper::content_tag (   $name,
  $content,
  $options = NULL,
  $escape = false 
)

Generates an arbitrary HTML tag.

Parameters
string$nameThe tag name
string$contentContent of the tag. If empty the tag will be self-closing
array$options(optional) Associative array of 'attribute' => 'value' for the HTML tag
boolean$escapeRequest a return escaped with htmlentities()
Returns
string An HTML tag

◆ content_type_meta_tag()

TagHelper::content_type_meta_tag (   $content = NULL)

Generates a <meta> tag for content type.

Parameters
string$content(optional) Custom content type
Returns
string HTML <meta> tag with content type

◆ link_to()

TagHelper::link_to (   $text = '',
  $link = NULL,
  $attributes = NULL 
)

Generates an anchor.

Parameters
string$textThe text to be displayed
string$link(optional) The href param of the tag. defaults to '#'
array$attributesAssociative array of 'attribute' => 'value' for the HTML tag
Returns
string HTML tag

◆ option_tag()

TagHelper::option_tag (   $text,
  $name,
  $value,
  $selected = NULL 
)

Generates an <option> HTML tag.

Parameters
string$textThe text to be displayed
string$nameThe name of the tag
string$valueThe value param of the HTML tag
bool$selectedThe selected param of the HTML tag
Returns
string HTML <option> tag

◆ pingback_link_tag()

TagHelper::pingback_link_tag (   $url = NULL)

Generates a <link> tag for the pingback url.

Parameters
string$url(optional) The pingack url. Defaults to the WP's one
Returns
string HTML <link> tag

◆ title_tag()

TagHelper::title_tag (   $title = NULL,
  $attributes = array() 
)

Generates the <title> html tag.

Parameters
string$title(optional) The title of your page
array$attributes(optional) An associative array of 'attribute' => 'value' for the HTML tag
Returns
string HTML <title> tag