aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/pluginwriter/hooks.rst
blob: 66fe3b4da4572451d2d2f556815e1cd3ad7cc928 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.. MediaGoblin Documentation

   Written in 2014 by MediaGoblin contributors

   To the extent possible under law, the author(s) have dedicated all
   copyright and related and neighboring rights to this software to
   the public domain worldwide. This software is distributed without
   any warranty.

   You should have received a copy of the CC0 Public Domain
   Dedication along with this software. If not, see
   <http://creativecommons.org/publicdomain/zero/1.0/>.


===============================
Documentation on Built-in Hooks
===============================

This section explains built-in hooks to MediaGoblin.


What hooks are available?
=========================

'collection_add_media'
----------------------

This hook is used by ``add_media_to_collection``
in ``mediagoblin.user_pages.lib``.
It gets a ``CollectionItem`` as its argument.
It's the newly created item just before getting committed.
So the item can be modified by the hook, if needed.
Changing the session regarding this item is currently
undefined behaviour, as the SQL Session might contain other
things.