-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtinyhelp-sample.php
77 lines (74 loc) · 2.56 KB
/
tinyhelp-sample.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Plugin Name: TinyHelp Sample
* Description: A sample plugin that demostrates how TinyHelp library could be used.
* Author: Arūnas Liuiza
* Author URI: https://srunas.co/
* Version: 1.0.0
*/
add_action( 'plugins_loaded', 'tinyhelp_sample' );
function tinyhelp_sample() {
$args = array(
'slug' => 'tinycoffee',
'name' => __( 'tinyCoffee', 'tinyhelp-sample' ),
'bottom_text' => __( 'This is a feature suggestion created by tinyHelp library', 'tinyhelp-sample' ),
'modules' => array(
'test' => array(
'name' => __( 'Test Module', 'tinyhelp-sample' ),
'short_description' => __( 'Short description for this injected module goes here', 'tinyhelp-sample' ),
'version' => '0.1.0',
'author_name' => __( 'Arūnas', 'tinyhelp-sample' ),
'author_uri' => 'https://arunas.co',
'search_terms' => array( 'test.*', 'backup', 'coffee' ),
'icons' => array(
'1x' => 'https://placeholder.pics/png/128',
'2z' => 'https://placeholder.pics/png/256',
'svg' => 'https://placeholder.pics/svg/300',
),
'links' => array(
array(
'type' => 'button',
'title' => __( 'Get started', 'tinyhelp-sample' ),
'link' => 'https://wp.org/plugins/tinycoffee',
'attributes' => array(
'target' => '_blank',
),
),
array(
'type' => 'link',
'title' => __( 'Learn More', 'tinyhelp-sample' ),
'link' => 'https://arunas.co',
'attributes' => array(
'target' => '_blank',
),
),
),
),
'test2' => array(
'name' => __( 'Test Module 2', 'tinyhelp-sample' ),
'short_description' => __( 'Short description for this injected module goes here', 'tinyhelp-sample' ),
'version' => '0.1.0',
'author_name' => __( 'Arūnas', 'tinyhelp-sample' ),
'author_uri' => 'https://arunas.co',
'search_terms' => array( 'testing', 'beta', 'backup' ),
'icons' => array(
'1x' => 'https://placeholder.pics/png/128',
'2z' => 'https://placeholder.pics/png/256',
'svg' => 'https://placeholder.pics/svg/300',
),
'links' => array(
array(
'type' => 'button',
'title' => __( 'Get started', 'tinyhelp-sample' ),
'link' => 'https://arunas.blog',
'attributes' => array(
'target' => '_blank',
),
),
),
),
),
);
require_once( __DIR__ . '/vendor/tinyhelp/tinyhelp/class-tinyhelp.php' );
$th = new TinyHelp( $args );
}