install_theme_search_form

The timeline below displays how wordpress function install_theme_search_form has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Displays search form for searching themes.
 *
 * @since 2.8.0
 *
 * @param bool $type_selector
 */
function install_theme_search_form($type_selector = true)
{
    $type = isset($_REQUEST['type']) ? wp_unslash($_REQUEST['type']) : 'term';
    $term = isset($_REQUEST['s']) ? wp_unslash($_REQUEST['s']) : '';
    if (!$type_selector) {
        echo '<p class="install-help">' . __('Search for themes by keyword.') . '</p>';
    }
    ?>
<form id="search-themes" method="get">
	<input type="hidden" name="tab" value="search" />
	<?php 
    if ($type_selector) {
        ?>
	<label class="screen-reader-text" for="typeselector">
		<?php 
        /* translators: Hidden accessibility text. */
        _e('Type of search');
        ?>
	</label>
	<select	name="type" id="typeselector">
	<option value="term" <?php 
        selected('term', $type);
        ?>><?php 
        _e('Keyword');
        ?></option>
	<option value="author" <?php 
        selected('author', $type);
        ?>><?php 
        _e('Author');
        ?></option>
	<option value="tag" <?php 
        selected('tag', $type);
        ?>><?php 
        _ex('Tag', 'Theme Installer');
        ?></option>
	</select>
	<label class="screen-reader-text" for="s">
		<?php 
        switch ($type) {
            case 'term':
                /* translators: Hidden accessibility text. */
                _e('Search by keyword');
                break;
            case 'author':
                /* translators: Hidden accessibility text. */
                _e('Search by author');
                break;
            case 'tag':
                /* translators: Hidden accessibility text. */
                _e('Search by tag');
                break;
        }
        ?>
	</label>
	<?php 
    } else {
        ?>
	<label class="screen-reader-text" for="s">
		<?php 
        /* translators: Hidden accessibility text. */
        _e('Search by keyword');
        ?>
	</label>
	<?php 
    }
    ?>
	<input type="search" name="s" id="s" size="30" value="<?php 
    echo esc_attr($term);
    ?>" autofocus="autofocus" />
	<?php 
    submit_button(__('Search'), '', 'search', false);
    ?>
</form>
	<?php 
}

WordPress Version: 6.1

/**
 * Displays search form for searching themes.
 *
 * @since 2.8.0
 *
 * @param bool $type_selector
 */
function install_theme_search_form($type_selector = true)
{
    $type = isset($_REQUEST['type']) ? wp_unslash($_REQUEST['type']) : 'term';
    $term = isset($_REQUEST['s']) ? wp_unslash($_REQUEST['s']) : '';
    if (!$type_selector) {
        echo '<p class="install-help">' . __('Search for themes by keyword.') . '</p>';
    }
    ?>
<form id="search-themes" method="get">
	<input type="hidden" name="tab" value="search" />
	<?php 
    if ($type_selector) {
        ?>
	<label class="screen-reader-text" for="typeselector"><?php 
        _e('Type of search');
        ?></label>
	<select	name="type" id="typeselector">
	<option value="term" <?php 
        selected('term', $type);
        ?>><?php 
        _e('Keyword');
        ?></option>
	<option value="author" <?php 
        selected('author', $type);
        ?>><?php 
        _e('Author');
        ?></option>
	<option value="tag" <?php 
        selected('tag', $type);
        ?>><?php 
        _ex('Tag', 'Theme Installer');
        ?></option>
	</select>
	<label class="screen-reader-text" for="s">
		<?php 
        switch ($type) {
            case 'term':
                _e('Search by keyword');
                break;
            case 'author':
                _e('Search by author');
                break;
            case 'tag':
                _e('Search by tag');
                break;
        }
        ?>
	</label>
	<?php 
    } else {
        ?>
	<label class="screen-reader-text" for="s"><?php 
        _e('Search by keyword');
        ?></label>
	<?php 
    }
    ?>
	<input type="search" name="s" id="s" size="30" value="<?php 
    echo esc_attr($term);
    ?>" autofocus="autofocus" />
	<?php 
    submit_button(__('Search'), '', 'search', false);
    ?>
</form>
	<?php 
}

WordPress Version: 5.1

/**
 * Display search form for searching themes.
 *
 * @since 2.8.0
 *
 * @param bool $type_selector
 */
function install_theme_search_form($type_selector = true)
{
    $type = isset($_REQUEST['type']) ? wp_unslash($_REQUEST['type']) : 'term';
    $term = isset($_REQUEST['s']) ? wp_unslash($_REQUEST['s']) : '';
    if (!$type_selector) {
        echo '<p class="install-help">' . __('Search for themes by keyword.') . '</p>';
    }
    ?>
<form id="search-themes" method="get">
	<input type="hidden" name="tab" value="search" />
	<?php 
    if ($type_selector) {
        ?>
	<label class="screen-reader-text" for="typeselector"><?php 
        _e('Type of search');
        ?></label>
	<select	name="type" id="typeselector">
	<option value="term" <?php 
        selected('term', $type);
        ?>><?php 
        _e('Keyword');
        ?></option>
	<option value="author" <?php 
        selected('author', $type);
        ?>><?php 
        _e('Author');
        ?></option>
	<option value="tag" <?php 
        selected('tag', $type);
        ?>><?php 
        _ex('Tag', 'Theme Installer');
        ?></option>
	</select>
	<label class="screen-reader-text" for="s">
		<?php 
        switch ($type) {
            case 'term':
                _e('Search by keyword');
                break;
            case 'author':
                _e('Search by author');
                break;
            case 'tag':
                _e('Search by tag');
                break;
        }
        ?>
	</label>
	<?php 
    } else {
        ?>
	<label class="screen-reader-text" for="s"><?php 
        _e('Search by keyword');
        ?></label>
	<?php 
    }
    ?>
	<input type="search" name="s" id="s" size="30" value="<?php 
    echo esc_attr($term);
    ?>" autofocus="autofocus" />
	<?php 
    submit_button(__('Search'), '', 'search', false);
    ?>
</form>
	<?php 
}

WordPress Version: 4.7

/**
 * Display search form for searching themes.
 *
 * @since 2.8.0
 *
 * @param bool $type_selector
 */
function install_theme_search_form($type_selector = true)
{
    $type = isset($_REQUEST['type']) ? wp_unslash($_REQUEST['type']) : 'term';
    $term = isset($_REQUEST['s']) ? wp_unslash($_REQUEST['s']) : '';
    if (!$type_selector) {
        echo '<p class="install-help">' . __('Search for themes by keyword.') . '</p>';
    }
    ?>
<form id="search-themes" method="get">
	<input type="hidden" name="tab" value="search" />
	<?php 
    if ($type_selector) {
        ?>
	<label class="screen-reader-text" for="typeselector"><?php 
        _e('Type of search');
        ?></label>
	<select	name="type" id="typeselector">
	<option value="term" <?php 
        selected('term', $type);
        ?>><?php 
        _e('Keyword');
        ?></option>
	<option value="author" <?php 
        selected('author', $type);
        ?>><?php 
        _e('Author');
        ?></option>
	<option value="tag" <?php 
        selected('tag', $type);
        ?>><?php 
        _ex('Tag', 'Theme Installer');
        ?></option>
	</select>
	<label class="screen-reader-text" for="s"><?php 
        switch ($type) {
            case 'term':
                _e('Search by keyword');
                break;
            case 'author':
                _e('Search by author');
                break;
            case 'tag':
                _e('Search by tag');
                break;
        }
        ?></label>
	<?php 
    } else {
        ?>
	<label class="screen-reader-text" for="s"><?php 
        _e('Search by keyword');
        ?></label>
	<?php 
    }
    ?>
	<input type="search" name="s" id="s" size="30" value="<?php 
    echo esc_attr($term);
    ?>" autofocus="autofocus" />
	<?php 
    submit_button(__('Search'), '', 'search', false);
    ?>
</form>
<?php 
}

WordPress Version: 4.3

/**
 * Display search form for searching themes.
 *
 * @since 2.8.0
 *
 * @param bool $type_selector
 */
function install_theme_search_form($type_selector = true)
{
    $type = isset($_REQUEST['type']) ? wp_unslash($_REQUEST['type']) : 'term';
    $term = isset($_REQUEST['s']) ? wp_unslash($_REQUEST['s']) : '';
    if (!$type_selector) {
        echo '<p class="install-help">' . __('Search for themes by keyword.') . '</p>';
    }
    ?>
<form id="search-themes" method="get">
	<input type="hidden" name="tab" value="search" />
	<?php 
    if ($type_selector) {
        ?>
	<label class="screen-reader-text" for="typeselector"><?php 
        _e('Type of search');
        ?></label>
	<select	name="type" id="typeselector">
	<option value="term" <?php 
        selected('term', $type);
        ?>><?php 
        _e('Keyword');
        ?></option>
	<option value="author" <?php 
        selected('author', $type);
        ?>><?php 
        _e('Author');
        ?></option>
	<option value="tag" <?php 
        selected('tag', $type);
        ?>><?php 
        _ex('Tag', 'Theme Installer');
        ?></option>
	</select>
	<label class="screen-reader-text" for="s"><?php 
        switch ($type) {
            case 'term':
                _e('Search by keyword');
                break;
            case 'author':
                _e('Search by author');
                break;
            case 'tag':
                _e('Search by tag');
                break;
        }
        ?></label>
	<?php 
    } else {
        ?>
	<label class="screen-reader-text" for="s"><?php 
        _e('Search by keyword');
        ?></label>
	<?php 
    }
    ?>
	<input type="search" name="s" id="s" size="30" value="<?php 
    echo esc_attr($term);
    ?>" autofocus="autofocus" />
	<?php 
    submit_button(__('Search'), 'button', 'search', false);
    ?>
</form>
<?php 
}

WordPress Version: 4.2

/**
 * Display search form for searching themes.
 *
 * @since 2.8.0
 */
function install_theme_search_form($type_selector = true)
{
    $type = isset($_REQUEST['type']) ? wp_unslash($_REQUEST['type']) : 'term';
    $term = isset($_REQUEST['s']) ? wp_unslash($_REQUEST['s']) : '';
    if (!$type_selector) {
        echo '<p class="install-help">' . __('Search for themes by keyword.') . '</p>';
    }
    ?>
<form id="search-themes" method="get">
	<input type="hidden" name="tab" value="search" />
	<?php 
    if ($type_selector) {
        ?>
	<label class="screen-reader-text" for="typeselector"><?php 
        _e('Type of search');
        ?></label>
	<select	name="type" id="typeselector">
	<option value="term" <?php 
        selected('term', $type);
        ?>><?php 
        _e('Keyword');
        ?></option>
	<option value="author" <?php 
        selected('author', $type);
        ?>><?php 
        _e('Author');
        ?></option>
	<option value="tag" <?php 
        selected('tag', $type);
        ?>><?php 
        _ex('Tag', 'Theme Installer');
        ?></option>
	</select>
	<label class="screen-reader-text" for="s"><?php 
        switch ($type) {
            case 'term':
                _e('Search by keyword');
                break;
            case 'author':
                _e('Search by author');
                break;
            case 'tag':
                _e('Search by tag');
                break;
        }
        ?></label>
	<?php 
    } else {
        ?>
	<label class="screen-reader-text" for="s"><?php 
        _e('Search by keyword');
        ?></label>
	<?php 
    }
    ?>
	<input type="search" name="s" id="s" size="30" value="<?php 
    echo esc_attr($term);
    ?>" autofocus="autofocus" />
	<?php 
    submit_button(__('Search'), 'button', 'search', false);
    ?>
</form>
<?php 
}

WordPress Version: 3.7

/**
 * Display search form for searching themes.
 *
 * @since 2.8.0
 */
function install_theme_search_form($type_selector = true)
{
    $type = isset($_REQUEST['type']) ? wp_unslash($_REQUEST['type']) : 'term';
    $term = isset($_REQUEST['s']) ? wp_unslash($_REQUEST['s']) : '';
    if (!$type_selector) {
        echo '<p class="install-help">' . __('Search for themes by keyword.') . '</p>';
    }
    ?>
<form id="search-themes" method="get" action="">
	<input type="hidden" name="tab" value="search" />
	<?php 
    if ($type_selector) {
        ?>
	<label class="screen-reader-text" for="typeselector"><?php 
        _e('Type of search');
        ?></label>
	<select	name="type" id="typeselector">
	<option value="term" <?php 
        selected('term', $type);
        ?>><?php 
        _e('Keyword');
        ?></option>
	<option value="author" <?php 
        selected('author', $type);
        ?>><?php 
        _e('Author');
        ?></option>
	<option value="tag" <?php 
        selected('tag', $type);
        ?>><?php 
        _ex('Tag', 'Theme Installer');
        ?></option>
	</select>
	<label class="screen-reader-text" for="s"><?php 
        switch ($type) {
            case 'term':
                _e('Search by keyword');
                break;
            case 'author':
                _e('Search by author');
                break;
            case 'tag':
                _e('Search by tag');
                break;
        }
        ?></label>
	<?php 
    } else {
        ?>
	<label class="screen-reader-text" for="s"><?php 
        _e('Search by keyword');
        ?></label>
	<?php 
    }
    ?>
	<input type="search" name="s" id="s" size="30" value="<?php 
    echo esc_attr($term);
    ?>" autofocus="autofocus" />
	<?php 
    submit_button(__('Search'), 'button', 'search', false);
    ?>
</form>
<?php 
}