diff options
author | ArthurHoaro <arthur@hoa.ro> | 2019-07-13 10:44:44 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2019-07-20 09:32:56 +0200 |
commit | 15a61e59746d138d9386d4ef1df4e0d9961b1774 (patch) | |
tree | 52856d857ccb9387922b7c16db018925b799119e /plugins/demo_plugin/demo_plugin.php | |
parent | b5507350543f9259196996a24bbae2717b1b20be (diff) | |
download | Shaarli-15a61e59746d138d9386d4ef1df4e0d9961b1774.tar.gz Shaarli-15a61e59746d138d9386d4ef1df4e0d9961b1774.tar.zst Shaarli-15a61e59746d138d9386d4ef1df4e0d9961b1774.zip |
Add the new hook save_plugin_parameters to the demo plugin
Diffstat (limited to 'plugins/demo_plugin/demo_plugin.php')
-rw-r--r-- | plugins/demo_plugin/demo_plugin.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php index 95ea7fe2..71ba7495 100644 --- a/plugins/demo_plugin/demo_plugin.php +++ b/plugins/demo_plugin/demo_plugin.php | |||
@@ -457,10 +457,29 @@ function hook_demo_plugin_render_feed($data) | |||
457 | } | 457 | } |
458 | 458 | ||
459 | /** | 459 | /** |
460 | * When plugin parameters are saved. | ||
461 | * | ||
462 | * @param array $data $_POST array | ||
463 | * | ||
464 | * @return array Updated $_POST array | ||
465 | */ | ||
466 | function hook_demo_plugin_save_plugin_parameters($data) | ||
467 | { | ||
468 | // Here we edit the provided value, but we can use this to generate config files, etc. | ||
469 | if (! empty($data['DEMO_PLUGIN_PARAMETER']) && ! endsWith($data['DEMO_PLUGIN_PARAMETER'], '_SUFFIX')) { | ||
470 | $data['DEMO_PLUGIN_PARAMETER'] .= '_SUFFIX'; | ||
471 | } | ||
472 | |||
473 | return $data; | ||
474 | } | ||
475 | |||
476 | /** | ||
460 | * This function is never called, but contains translation calls for GNU gettext extraction. | 477 | * This function is never called, but contains translation calls for GNU gettext extraction. |
461 | */ | 478 | */ |
462 | function demo_dummy_translation() | 479 | function demo_dummy_translation() |
463 | { | 480 | { |
464 | // meta | 481 | // meta |
465 | t('A demo plugin covering all use cases for template designers and plugin developers.'); | 482 | t('A demo plugin covering all use cases for template designers and plugin developers.'); |
483 | t('This is a parameter dedicated to the demo plugin. It\'ll be suffixed.'); | ||
484 | t('Other demo parameter'); | ||
466 | } | 485 | } |