From deca336d7f02a06301ce310653eda22f631931c1 Mon Sep 17 00:00:00 2001 From: Mike van den Hoek Date: Fri, 28 May 2021 16:11:09 +0200 Subject: [PATCH] (feat): add explanation to 'show on' taxonomy form --- CHANGELOG.md | 4 +++ languages/openpub-base-nl_NL.mo | Bin 8327 -> 8724 bytes languages/openpub-base-nl_NL.po | 8 ++++++ languages/openpub-base.pot | 8 ++++++ openpub-base.php | 2 +- src/Base/Foundation/Plugin.php | 2 +- src/Base/Taxonomy/TaxonomyController.php | 25 ++++++++++++++++++ src/Base/Taxonomy/TaxonomyServiceProvider.php | 16 ++++++++++- 8 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 src/Base/Taxonomy/TaxonomyController.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 74cc798..49b4b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Version [2.0.8] + +- Add explanation to 'show on' taxonomy form. + ## Version [2.0.7] ### Refactor diff --git a/languages/openpub-base-nl_NL.mo b/languages/openpub-base-nl_NL.mo index 47594658e2363c3deae993992ab5ac21acd8abb3..a07a8d99da64eb3d3190e18e95fb1e4155b83f23 100644 GIT binary patch delta 2984 zcmY+_Yitx%7{>8~KntzqCQ|O4%B@^lKqxmAskQ_(VTC^9(V-x;A7YaPhxL88(hDL z8t*D#@n=+`zoN#yjfFhl6p$``GYECVXuJo@(Bf1q#^tCPyQorT@IKsy zL+}u4;M1rFp2x9x2{pdHOxF~l?i+?#t;J+Iqp$`az$VlH+fgOkiJI{t&RMK{NjXRpPHv8D2+a{3r5f3b;56 zhvERNMePj-wS?PHrQd<7%wE)e?*-RSp%OcTO6;e8)L%2{$@G-b$iUgC#Afq7VsN^l8I$JMBDUkf~h4V-_9+I$np&f@$moyBxQSc6A#65hh4IEHd) z?GmU;yoglUyo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HgD=F)}4R;`mPGu!FrEt|2x8ccDErh4gpKH$o zMMh{O9`=p zc$Bz@u=uw0mL#W@tzgSTw*0Lj(CKy+)hj*{7tyN zRC2SKSRNav;5^0;%s" #~ msgstr "Deze link werkt niet, bekijk onze website: %s" + +#: src/Base/Taxonomy/TaxonomyController.php:21 +msgid "Additional explanation" +msgstr "Aanvullende uitleg" + +#: src/Base/Taxonomy/TaxonomyController.php:22 +msgid "The slug value must be the ID of the blog you want to add as term. The ID is used for displaying the correct openpub-items on every blog." +msgstr "De waarde van de slug moet het ID zijn van de blog die je wilt toevoegen als term. Het ID wordt gebruikt om de juiste openpub-items weer te geven op alle blogs." diff --git a/languages/openpub-base.pot b/languages/openpub-base.pot index 87cbf8c..05147eb 100644 --- a/languages/openpub-base.pot +++ b/languages/openpub-base.pot @@ -422,3 +422,11 @@ msgstr "" #, php-format msgid "Connection type \"%s\" does not exist" msgstr "" + +#: src/Base/Taxonomy/TaxonomyController.php:21 +msgid "Additional explanation" +msgstr "" + +#: src/Base/Taxonomy/TaxonomyController.php:22 +msgid "The slug value must be the ID of the blog you want to add as term. The ID is used for displaying the correct openpub-items on every blog." +msgstr "" diff --git a/openpub-base.php b/openpub-base.php index ed92302..786534a 100644 --- a/openpub-base.php +++ b/openpub-base.php @@ -4,7 +4,7 @@ * Plugin Name: Yard | OpenPub Base * Plugin URI: https://www.openwebconcept.nl/ * Description: Acts as foundation for other OpenPub related content plugins. This plugin implements actions to allow for other plugins to add and/or change Custom Posttypes, Metaboxes, Taxonomies, en Posts 2 posts relations. - * Version: 2.0.7 + * Version: 2.0.8 * Author: Yard | Digital Agency * Author URI: https://www.yard.nl/ * License: GPL-3.0 diff --git a/src/Base/Foundation/Plugin.php b/src/Base/Foundation/Plugin.php index bc4a214..0cf1801 100644 --- a/src/Base/Foundation/Plugin.php +++ b/src/Base/Foundation/Plugin.php @@ -25,7 +25,7 @@ class Plugin * * @var string VERSION */ - const VERSION = '2.0.7'; + const VERSION = '2.0.8'; /** * Path to the root of the plugin. diff --git a/src/Base/Taxonomy/TaxonomyController.php b/src/Base/Taxonomy/TaxonomyController.php new file mode 100644 index 0000000..07556c5 --- /dev/null +++ b/src/Base/Taxonomy/TaxonomyController.php @@ -0,0 +1,25 @@ + +

' . __('Additional explanation', 'openpub-base') . '

+

' . __('The slug value must be the ID of the blog you want to add as term. The ID is used for displaying the correct openpub-items on every blog.', 'openpub-base') . '

+ '; + } +} diff --git a/src/Base/Taxonomy/TaxonomyServiceProvider.php b/src/Base/Taxonomy/TaxonomyServiceProvider.php index 236933d..1695a46 100644 --- a/src/Base/Taxonomy/TaxonomyServiceProvider.php +++ b/src/Base/Taxonomy/TaxonomyServiceProvider.php @@ -20,10 +20,24 @@ class TaxonomyServiceProvider extends ServiceProvider public function register(): void { $this->plugin->loader->addAction('init', $this, 'registerTaxonomies'); + + if ($this->plugin->settings->useShowOn()) { + $this->showOnFormFields(); + } + } + + /** + * Add elements to the taxonomy form. + * + * @return void + */ + protected function showOnFormFields() + { + $this->plugin->loader->addAction('openpub-show-on_add_form_fields', TaxonomyController::class, 'addShowOnExplanation'); } /** - * Register custom taxonomies via extended_cpts + * Register custom taxonomies via extended_cpts. * * @return void */