Skip to content

Commit d8cbdec

Browse files
authored
New: Add theme home to Finder [TMZ-935] (#549)
1 parent 6ab0b47 commit d8cbdec

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace HelloTheme\Modules\AdminHome\Components;
4+
5+
if ( ! defined( 'ABSPATH' ) ) {
6+
exit;
7+
}
8+
9+
class Finder {
10+
11+
public function add_hello_theme_finder_entry( $categories_data ) {
12+
if ( isset( $categories_data['site'] ) && isset( $categories_data['site']['items'] ) ) {
13+
$categories_data['site']['items']['hello-elementor-home'] = [
14+
'title' => esc_html__( 'Hello Theme Home', 'hello-elementor' ),
15+
'icon' => 'paint-brush',
16+
'url' => admin_url( 'admin.php?page=hello-elementor' ),
17+
'keywords' => [ 'theme', 'hello', 'home', 'plus', '+' ],
18+
];
19+
}
20+
21+
return $categories_data;
22+
}
23+
24+
public function __construct() {
25+
add_filter( 'elementor/finder/categories', [ $this, 'add_hello_theme_finder_entry' ] );
26+
}
27+
}

modules/admin-home/module.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ protected function get_component_ids(): array {
3535
'Admin_Top_Bar',
3636
'Settings_Controller',
3737
'Notificator',
38+
'Finder',
3839
];
3940
}
4041
}

0 commit comments

Comments
 (0)