From bdef054d453697c10ea4c956ff3b04a4fea46aaa Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Fri, 7 Feb 2020 13:31:52 -0300 Subject: [PATCH] Changes extra components function register and array name --- src/views/admin/js/main.js | 14 +++++++------- src/views/class-tainacan-component-hooks.php | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/views/admin/js/main.js b/src/views/admin/js/main.js index eb5a00f2a..c302c70e7 100644 --- a/src/views/admin/js/main.js +++ b/src/views/admin/js/main.js @@ -69,6 +69,13 @@ Vue.use(ConsolePlugin, {visual: false}); Vue.use(VueTheMask); Vue.use(CommentsStatusHelperPlugin); + +/* Registers Extra Vue Components passed to the TainacanExtraVueComponents */ +if (typeof TainacanExtraVueComponents != "undefined") { + for (let [extraVueComponentName, extraVueComponentObject] of Object.entries(TainacanExtraVueComponents)) + Vue.component(extraVueComponentName, extraVueComponentObject); +} + /* Metadata */ Vue.component('tainacan-text', Text); Vue.component('tainacan-textarea', Textarea); @@ -99,13 +106,6 @@ Vue.component('tainacan-filter-numeric-interval', FilterNumericInterval); Vue.component('tainacan-filter-numeric-list-interval', FilterNumericListInterval); Vue.component('tainacan-filter-date-interval', FilterDateInterval); -/* Registers Extra Filter Components passed to the TainacanExtraFilter */ -if (typeof TainacanExtraFilters != "undefined") { - for (let [extraFilter, extraFilterObject] of Object.entries(TainacanExtraFilters)) - Vue.component(extraFilter, extraFilterObject); -} - - /* Filter Metadata Option forms */ Vue.component('tainacan-filter-form-numeric', FormFilterNumeric); Vue.component('tainacan-filter-form-numeric-interval', FormFilterNumericInterval); diff --git a/src/views/class-tainacan-component-hooks.php b/src/views/class-tainacan-component-hooks.php index 51bd35cb1..6c38a6a57 100644 --- a/src/views/class-tainacan-component-hooks.php +++ b/src/views/class-tainacan-component-hooks.php @@ -29,7 +29,7 @@ class Component_Hooks { } private function init() { - do_action('tainacan-register-js-component', $this); + do_action('tainacan-register-vuejs-component', $this); } public function register_component() { @@ -37,13 +37,13 @@ class Component_Hooks { } /** - * Register a new component + * Register a new vuejs component * * @param string $handle name of the component. Should be unique. * @param string $script_path path of file component * @param array|string $args */ - public function register_js_component($handle, $script_path, $args = []) { + public function register_vuejs_component($handle, $script_path, $args = []) { global $TAINACAN_EXTRA_SCRIPTS; $this->handle = $handle;