| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Output\Hook; |
| 4 | |
| 5 | use MediaWiki\Title\Title; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "LanguageLinks" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface LanguageLinksHook { |
| 15 | /** |
| 16 | * Use this hook to manipulate a page's language links. This hook is called |
| 17 | * in various places to allow extensions to define the effective language |
| 18 | * links for a page. |
| 19 | * |
| 20 | * @since 1.35 |
| 21 | * |
| 22 | * @param Title $title |
| 23 | * @param string[] &$links Array with elements of the form "language:title" in the order |
| 24 | * that they will be output |
| 25 | * @param array &$linkFlags Associative array mapping prefixed links to arrays of flags. |
| 26 | * Currently unused, but planned to provide support for marking individual |
| 27 | * language links in the UI, e.g. for featured articles. |
| 28 | * @return bool|void True or no return value to continue or false to abort |
| 29 | */ |
| 30 | public function onLanguageLinks( $title, &$links, &$linkFlags ); |
| 31 | } |
| 32 | |
| 33 | /** @deprecated class alias since 1.42 */ |
| 34 | class_alias( LanguageLinksHook::class, 'MediaWiki\Hook\LanguageLinksHook' ); |