install_search_form( bool $deprecated = true )
- Since
- 2.7.0, 4.6.0
- Source
wp-admin/includes/plugin-install.php:313
Compatibility
- WordPress
- since 4.6.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$deprecatedbooloptional- Not used.Default:
true
Performance profile
How much work a call to install_search_form() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Trivial
- Scaling
- Constant
- Instructions
- 65–82
- Plugin surface
- None
- Called by
- 1
Touches nothing outside its own arguments.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 84.
Nothing here hands control to plugin code.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- hookthird-party callbacks
apply_filters()one call below install_search_form()
Further down the call graph this can also reach option, cache, serialize, query and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 4 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost install_search_form() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!isset($value) | 65 | _e(), esc_attr(), _e(), selected(), _e(), selected(), _e(), selected(), _ex(), __(), submit_button() |
| always | 72 | wp_unslash(), _e(), esc_attr(), _e(), selected(), _e(), selected(), _e(), selected(), _ex(), __(), submit_button() |
| always | 75 | wp_unslash(), urldecode(), _e(), esc_attr(), _e(), selected(), _e(), selected(), _e(), selected(), _ex(), __(), submit_button() |
isset($value) | 82 | wp_unslash(), wp_unslash(), urldecode(), _e(), esc_attr(), _e(), selected(), _e(), selected(), _e(), selected(), _ex(), __(), submit_button() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 82 | 65–80 | 2 | 2 fewer instructions than PHP 8.5 |
| 8.5 | 84 | 65–82 | 2 | |
| 8.4 | 84 | 65–82 | 2 | |
| 8.3 | 84 | 65–82 | 2 | |
| 8.2 | 84 | 65–82 | 2 | |
| 8.1 | 84 | 65–82 | 2 | |
| 7.4 | 84 | 65–82 | 2 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 7
- wp_unslash()Removes slashes from a string or recursively removes slashes from strings within an array.
- _e()Displays translated text.
- esc_attr()Escaping for HTML attributes.
- selected()Outputs the HTML selected attribute.
- _ex()Displays translated string with gettext context.
- submit_button()Echoes a submit button, with provided text and appropriate class(es).
- __()Retrieves the translation of $text.
Used by · 1
- WP_Plugin_Install_List_Table::views()Overrides parent views so we can use the filter bar display.
Source code
function install_search_form( $deprecated = true ) { $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term'; $term = isset( $_REQUEST['s'] ) ? urldecode( wp_unslash( $_REQUEST['s'] ) ) : ''; ?> <form class="search-form search-plugins" method="get"> <input type="hidden" name="tab" value="search" /> <label for="search-plugins"><?php _e( 'Search Plugins' ); ?></label> <input type="search" name="s" id="search-plugins" value="<?php echo esc_attr( $term ); ?>" class="wp-filter-search" /> <label class="screen-reader-text" for="typeselector"> <?php /* translators: Hidden accessibility text. */ _e( 'Search plugins by:' ); ?> </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', 'Plugin Installer' ); ?></option> </select> <?php submit_button( __( 'Search Plugins' ), 'hide-if-js', false, false, array( 'id' => 'search-submit' ) ); ?> </form> <?php}Changelog
Introduced in 2.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$type_selector parameter was deprecated.from the docblockAbout this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, from
src/wp-admin/includes/plugin-install.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.