Chapter 19. Setting and using Hooks

Setting Site-Specific Hooks

Table of Contents

1. Writing Hooks
2. Hooks Reference

Abstract

The LiveJournal code provides a number of hooks, which you can use to alter or extend the functionality of the code, tailored for your own site. You are free to implement as few or as many as you want.

Tip

If there is a hook you want but don't see, e-mail us at or post an entry to the lj_dev[o] community and we will be more than happy to add it in.

One of the reasons for implementing hooks on LiveJournal came from a need to make distinctions between account status types, without leaving a lot of kludge in the code base, and without having to write extensive code libraries in the ljcom CVS repository.

Hooks are code references, subroutines that perform functions or return information based on objects passed to the subroutine. Some programming knowledge is necessary to write your own hooks.