]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - doc/md/Plugin-System.md
emojione & twemoji removed
[github/shaarli/Shaarli.git] / doc / md / Plugin-System.md
index 30f0ae7448a033b5964b4032535674047b289ab9..9b0d3a7db5acf08a6caeb0bf1cff1a4b9af759bd 100644 (file)
@@ -49,10 +49,10 @@ hook_<plugin_name>_<hook_name>($data, $conf)
 
 Parameters:
 
-- data: see [$data section](https://github.com/shaarli/Shaarli/wiki/Plugin-System#plugins-data)
+- data: see [$data section](https://shaarli.readthedocs.io/en/master/Plugin-System/#plugins-data)
 - conf: the `ConfigManager` instance.
 
-For exemple, if my plugin want to add data to the header, this function is needed:
+For example, if my plugin want to add data to the header, this function is needed:
 
     hook_demo_plugin_render_header
 
@@ -137,6 +137,7 @@ If it's still not working, please [open an issue](https://github.com/shaarli/Sha
 | [render_feed](#render_feed) | Allow to do add tags in RSS and ATOM feeds. |
 | [save_link](#save_link) | Allow to alter the link being saved in the datastore. |
 | [delete_link](#delete_link) | Allow to do an action before a link is deleted from the datastore. |
+| [save_plugin_parameters](#save_plugin_parameters) | Allow to manipulate plugin parameters before they're saved. |
 
 
 
@@ -471,6 +472,22 @@ Allow to execute any action before the link is actually removed from the datasto
 - created
 - updated
 
+
+#### save_plugin_parameters
+
+Triggered when the plugin parameters are saved from the plugin administration page.
+
+Plugins can perform an action every times their settings are updated.
+For example it is used to update the CSS file of the `default_colors` plugins.
+
+##### Data
+
+`$data` input contains the `$_POST` array.
+
+So if the plugin has a parameter called `MYPLUGIN_PARAMETER`,
+the array will contain an entry with `MYPLUGIN_PARAMETER` as a key.
+
+
 ## Guide for template designer
 
 ### Plugin administration