PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.5.3
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.5.3
4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.5.2 All 199 releases
betterdocs / includes / Editors / BlockEditor / Blocks / SearchForm.php

SearchForm.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 3.5.3, at includes/Editors/BlockEditor/Blocks/SearchForm.php

52 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPDeveloper\BetterDocs\Editors\BlockEditor\Blocks;
4
5 use WPDeveloper\BetterDocs\Editors\BlockEditor\Block;
6
7 class SearchForm extends Block {
8 public $view_wrapper = 'betterdocs-search-form-wrapper';
9
10 protected $editor_styles = [
11 'betterdocs-search'
12 ];
13
14 protected $frontend_styles = [
15 'betterdocs-search'
16 ];
17 protected $frontend_scripts = [
18 'betterdocs-search'
19 ];
20
21 /**
22 * unique name of block
23 * @return string
24 */
25 public function get_name() {
26 return 'searchbox';
27 }
28
29 public function get_default_attributes() {
30 return [
31 'blockId' => '',
32 'placeholderText' => __( 'Search', 'betterdocs' )
33 ];
34 }
35
36 public function render( $attributes, $content ) {
37 $this->views( 'widgets/search-form' );
38 }
39
40 public function view_params() {
41 $settings = &$this->attributes;
42
43 $_shortcode_attributes = apply_filters( 'betterdocs_elementor_search_form_params', [
44 'placeholder' => esc_html( $settings['placeholderText'] )
45 ], $this->attributes );
46
47 return [
48 'shortcode_attr' => $_shortcode_attributes
49 ];
50 }
51 }
52