List of API Strings – Thesis 2 Development

This is a list of API strings used in Thesis 2 skin and Box development. These strings are are found within the Thesis API and can aid in reducing development time as well as keeping your code clean.

Here is an example Box options array demonstrating the usage of these strings.

protected function html_options()
    global $thesis;
    return array(
        'alignment' => array(
            'type' => 'select',
            'label' => $thesis->api->strings['alignment'],
            'tooltip' => $thesis->api->strings['alignment_tooltip'],
            'options' => array(
                '' => $thesis->api->strings['alignnone'],
                'left' => $thesis->api->strings['alignleft'],
                'right' => $thesis->api->strings['alignright'],
                'center' => $thesis->api->strings['aligncenter'])),
        'link' => array(
            'type' => 'checkbox',
            'options' => array(
                'link' => __('Link image to post', 'thesis')),
            'default' => array(
                'link' => true)));

As you can see there are a number of strings and they help to keep your code clean and consistent.

It is important to understand that in order to use these strings, you must include the global $thesis variable.


Using these strings can save you a lot of time and it is simply a case of referencing the correct string.


Thesis API Strings

String RefString Output
aligncentercentered (no wrap)
alignleftleft with text wrap
alignmentDefault Alignment
alignment_tooltipIf you select an alignment, a corresponding HTML class will be added to your image. Please note that your active Skin may not support image alignment.
alignnoneleft with no text wrap
alignrightright with text wrap
alt_tooltipAdding alt text will help you derive the maximum SEO benefit from your image. Be concise and descriptive!
attr_nameYou can add attributes to your HTML containers; for example, data-type="post". You can even use this space for multiple attribute declarations.
auto_wp_labelAutomatic WordPress Post Classes
auto_wp_optionUse automatically-generated WordPress post classes
auto_wp_tooltipWordPress can output post classes that allow you to target specific types of posts more easily. Target by post type, category, tag, taxonomy, author, and more.
avatar_sizeAvatar Size
avatar_tooltipYour author avatars will display at the size you enter here. If you enter nothing, your avatars will be 96px square, and we recommend doing this so you can instead control the sizing with CSS. Please note that avatars will always be returned as square images (eg. 96×96 pixels).
caption_tooltipAfter headlines, sub-headings and image captions are the most commonly read items on web pages. Don’t miss this opportunity to engage your readers—add a caption to your image!
character_separatorCharacter Separator

Note: class names cannot begin with numbers!
class_tooltipIf you want to target this box with CSS or JavaScript, you should enter a class name here.
click_to_editclick to edit
click_to_readclick to read
comment_permalinkpermalink to this comment
comment_term_pluralComment Term Plural
comment_term_singularComment Term Singular
custom_link_textCustom Link Text
custom_templateCustom Template
date_tooltipThis field accepts a PHP date format.
description_counterSearch engines allow a maximum of roughly 150 characters for the description.
display_optionsDisplay Options
frame_labelFrame This Image?
frame_optionadd a frame to this image
frame_tooltipIf you set this option to true, then an HTML class of frame will be added to your image. Please note that your active Skin may not support image framing.
hook_labelUnique Hook Name
hook_tooltip_1If you want to access this box programmatically, you should supply a unique hook name here. Your hook references will then become:
hook_tooltip_2…where {name} is equal to the value you enter here.
html_classHTML class
html_headHTML Head
html_idHTML id
html_tagHTML Tag
id_tooltipIf you need to target this box individually with CSS or JavaScript, you can enter an id here.

Note: ids cannot begin with numbers, and only one id is valid per box!
include_http(including http:// or https://)
intro_textIntro Text
link_textLink Text
meta_descriptionMeta Description
meta_keywordsMeta Keywords
meta_robotsMeta Robots
no_htmlno HTML tags allowed
not_recommended(not recommended)
not_savednot saved
placeholderPlaceholder Text
placeholder_tooltipBy providing HTML5 placeholder text, you can give users an example of the info they should enter into this form field.
posts_to_showNumber of Posts to Show
show_labelshow input label
skin_defaultuse Skin default (recommended)
submit_button_textSubmit Button Text
this_pagethis page
title_counterSearch engines allow a maximum of 70 characters for the title.
title_tagTitle Tag
tracking_scriptsTracking Scripts
use_custom_textuse custom text
use_post_titleuse post title (recommended)
Note: This reference table will always be up to date because it is generated by directly accessing the API strings. Don’t forget to Bookmark it!

Meet the Author

Matthew Horne

Matthew Horne is web developer who specializes in optimized development. He also builds custom solutions instead of reverting to plugins. Matthew Has a strong understanding of PHP, JavaScript, jQuery.

1 comment… add one
  • Pedro Lima Jan 28, 2015, 11:30 pm

    Hey Matt,

    Thanks for taking the time to write this reference list. I does help a lot!

Leave a Comment