WP_Widget_Search::__construct() WordPress Method

Search widgets are a great way to help your visitors find the content they're looking for on your website. The WP_Widget_Search::__construct() method allows you to create a search widget for your WordPress site. This method takes two arguments: the id of the widget and the name of the widget.

WP_Widget_Search::__construct() #

Sets up a new Search widget instance.


Source

File: wp-includes/widgets/class-wp-widget-search.php

	public function __construct() {
		$widget_ops = array(
			'classname'                   => 'widget_search',
			'description'                 => __( 'A search form for your site.' ),
			'customize_selective_refresh' => true,
			'show_instance_in_rest'       => true,
		);
		parent::__construct( 'search', _x( 'Search', 'Search widget' ), $widget_ops );
	}


Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.