install_search_form

Displays a search form for searching plugins.

Description

install_search_form( (bool) $deprecated = true ); 

Parameters (1)

0. $deprecated — Optional. (bool) => true
The deprecated.

Usage

  1. if ( !function_exists( 'install_search_form' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/plugin-install.php'; 
  3.  
  4. // The deprecated. 
  5. $deprecated = true; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = install_search_form($deprecated); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/plugin-install.php  
  1. function install_search_form( $deprecated = true ) { 
  2. $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term'; 
  3. $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : ''; 
  4. ?><form class="search-form search-plugins" method="get"> 
  5. <input type="hidden" name="tab" value="search" /> 
  6. <label class="screen-reader-text" for="typeselector"><?php _e( 'Search plugins by:' ); ?></label> 
  7. <select name="type" id="typeselector"> 
  8. <option value="term"<?php selected( 'term', $type ); ?>><?php _e( 'Keyword' ); ?></option> 
  9. <option value="author"<?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option> 
  10. <option value="tag"<?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Plugin Installer' ); ?></option> 
  11. </select> 
  12. <label><span class="screen-reader-text"><?php _e( 'Search Plugins' ); ?></span> 
  13. <input type="search" name="s" value="<?php echo esc_attr( $term ) ?>" class="wp-filter-search" placeholder="<?php esc_attr_e( 'Search plugins...' ); ?>" /> 
  14. </label> 
  15. <?php submit_button( __( 'Search Plugins' ), 'hide-if-js', false, false, array( 'id' => 'search-submit' ) ); ?> 
  16. </form><?php