-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi-explorer.php
43 lines (32 loc) · 1.22 KB
/
api-explorer.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
<?php
declare(strict_types=1);
/**
* Plugin Name: API Explorer
* Plugin URI: https://github.com/Awilum/wp-api-explorer
* Description: WordPress plugins adds API Explorer link for pages, posts, tags, categories and comments
* Author: Sergey Romanenko
* Version: 1.0.0
* Author URI: https://awilum.github.io/
*/
require_once __DIR__ . '/includes/vars.php';
Vars::$storage['views_directory'] = __DIR__ . '/views/';
Vars::$storage['views_extension'] = 'php';
require_once __DIR__ . '/includes/view.php';
add_filter('comment_row_actions', function($actions, $data) {
return array_merge($actions, [view('link_row', ['data' => $data])]);
}, 100, 2);
add_filter('tag_row_actions', function($actions, $data) {
return array_merge($actions, [view('link_row', ['data' => $data])]);
}, 100, 2);
add_filter('page_row_actions', function($actions, $data) {
return array_merge($actions, [view('link_row', ['data' => $data])]);
}, 100, 2);
add_filter('post_row_actions', function($actions, $data) {
return array_merge($actions, [view('link_row', ['data' => $data])]);
}, 100, 2);
add_action('admin_footer', function() {
echo view('explorer');
});
add_action('admin_print_footer_scripts', function() {
echo view('js');
});