diff --git a/CHANGELOG.md b/CHANGELOG.md index 14367dc..0a31b2c 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -# [1.0.0](https://github.com/wp-extends/api-explorer) (2022-xx-xx) +# [1.0.0](https://github.com/Awilum/wp-api-explorer) (2022-10-04) * Initial release diff --git a/api-explorer.php b/api-explorer.php index a5cc526..98fdf82 100644 --- a/api-explorer.php +++ b/api-explorer.php @@ -4,42 +4,40 @@ /** * Plugin Name: API Explorer - * Plugin URI: https://github.com/Awilum - * Description: 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://github.com/Awilum + * Author URI: https://awilum.github.io/ */ -use Glowy\View\View; +require_once __DIR__ . '/includes/vars.php'; -! is_file($autoload = __DIR__ . '/vendor/autoload.php') and exit('Please run: composer install'); +Vars::$storage['views_directory'] = __DIR__ . '/views/'; +Vars::$storage['views_extension'] = 'php'; -$loader = require_once $autoload; - -View::setDirectory(__DIR__ . '/views/'); -View::setExtension('php'); +require_once __DIR__ . '/includes/view.php'; add_filter('comment_row_actions', function($actions, $data) { - return array_merge($actions, [view('link_row')->with(['data' => $data])->render()]); + 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')->with(['data' => $data])->render()]); + 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')->with(['data' => $data])->render()]); + 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')->with(['data' => $data])->render()]); + return array_merge($actions, [view('link_row', ['data' => $data])]); }, 100, 2); add_action('admin_footer', function() { - view('explorer')->display(); + echo view('explorer'); }); add_action('admin_print_footer_scripts', function() { - view('js')->display(); + echo view('js'); }); \ No newline at end of file diff --git a/composer.json b/composer.json deleted file mode 100644 index c77d48f..0000000 --- a/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "wp-extends/api-explorer", - "description": "Rest API explorer for WordPress", - "license": "MIT", - "keywords": [ - "wp", "wordpress", "restapi", "rest", "api" - ], - "support": { - "source": "https://github.com/wp-extends/api-explorer", - "issues": "https://github.com/wp-extends/api-explorer/issues" - }, - "authors": [ - { - "name": "Sergey Romanenko", - "email": "sergey.romanenko@flextype.org", - "homepage": "https://github.com/Awilum" - } - ], - "require": { - "php": "^7.4 || ^8.0", - "ext-json": "*", - "ext-mbstring": "*", - "ext-spl": "*", - "ext-fileinfo": "*", - "glowy/view": "^1.0.0" - }, - "require-dev": { - "symfony/var-dumper": "^5.3.6" - } -} diff --git a/includes/vars.php b/includes/vars.php new file mode 100644 index 0000000..aa2225a --- /dev/null +++ b/includes/vars.php @@ -0,0 +1,5 @@ +comment_ID; break; default: - # code... + break; } ?>