+}
+
+/**
+ * Execute render_feed hook.
+ * Called with ATOM and RSS feed.
+ *
+ * Special data keys:
+ * - _PAGE_: current page
+ * - _LOGGEDIN_: true/false
+ *
+ * @param array $data data passed to plugin
+ *
+ * @return array altered $data.
+ */
+function hook_demo_plugin_render_feed($data)
+{
+ foreach ($data['links'] as &$link) {
+ if ($data['_PAGE_'] == TemplatePage::FEED_ATOM) {
+ $link['description'] .= ' - ATOM Feed' ;
+ } elseif ($data['_PAGE_'] == TemplatePage::FEED_RSS) {
+ $link['description'] .= ' - RSS Feed';
+ }
+ }
+ return $data;
+}
+
+/**
+ * When plugin parameters are saved.
+ *
+ * @param array $data $_POST array
+ *
+ * @return array Updated $_POST array
+ */
+function hook_demo_plugin_save_plugin_parameters($data)
+{
+ // Here we edit the provided value.
+ // This hook can also be used to generate config files, etc.
+ if (! empty($data['DEMO_PLUGIN_PARAMETER']) && ! endsWith($data['DEMO_PLUGIN_PARAMETER'], '_SUFFIX')) {
+ $data['DEMO_PLUGIN_PARAMETER'] .= '_SUFFIX';
+ }
+
+ return $data;
+}
+
+/**
+ * This hook is called when a search is performed, on every search entry.
+ * It allows to add custom filters, and filter out additional link.
+ *
+ * For exemple here, we hide all bookmarks not containing the letter 'e' in their description.
+ *
+ * @param Bookmark $bookmark Search entry. Note that this is a Bookmark object, and not a link array.
+ * It should NOT be altered.
+ * @param array $context Additional info on the search performed.
+ *
+ * @return bool True if the bookmark should be kept in the search result, false to discard it.
+ */
+function hook_demo_plugin_filter_search_entry(Bookmark $bookmark, array $context): bool
+{
+ if (isset($_GET['e'])) {
+ return strpos($bookmark->getDescription(), 'e') !== false;
+ }
+
+ return true;
+}
+
+/**
+ * This function is never called, but contains translation calls for GNU gettext extraction.
+ */
+function demo_dummy_translation()
+{
+ // meta
+ t('A demo plugin covering all use cases for template designers and plugin developers.');
+ t('This is a parameter dedicated to the demo plugin. It\'ll be suffixed.');
+ t('Other demo parameter');
+}