Title: Handbook Examples: Documentation
Author: Jose Castaneda
Published: March 3, 2015
Last modified: April 14, 2015

---

 [  ](https://profiles.wordpress.org/jcastaneda/) [Jose Castaneda](https://profiles.wordpress.org/jcastaneda/)
9:53 pm _on_ March 3, 2015      

# Handbook Examples: Documentation

Any good theme has some documentation. A video tutorial on how to setup some basic
options, a specific page on how to use hooksHooks In WordPress theme and development,
hooks are functions that can be applied to an action or a Filter in WordPress. Actions
are functions performed when a certain event occurs in WordPress. Filters allow 
you to modify certain functions. Arguments used to hook both filters and actions
look the same. inside of the theme. How to make child themeChild theme A Child Theme
is a customized theme based upon a Parent Theme. It’s considered best practice to
create a child theme if you want to modify the CSS of your theme. [https://developer.wordpress.org/themes/advanced-topics/child-themes/](https://developer.wordpress.org/themes/advanced-topics/child-themes/)
or even a simple how to install the theme. These are examples of documentation. 
Let’s keep this going by leaving a comment below on some documentation examples.

I’ll start it off:

**Action hook**

    ```
    /*
     * Fires before the opening #page tag
     */
    function theme_before_page(){
        do_action( 'theme_before_page' );
    }
    ```

**FilterFilter Filters are one of the two types of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
They provide a way for functions to modify data of other functions. They are the
counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
manner, and should never have side effects such as affecting global variables and
output. hook**

    ```
    /*
     * Returns a specified width for the slider
     * 
     * Usage:
     * add_filter( 'theme_slider_width', 'my_callback' );
     * function my_callback(){
     *     return 755;
     * }
     */
    $width = intval( apply_filters( 'theme_slider_width', 600 ) );
    ```

### Share this:

 * [  Threads ](https://make.wordpress.org/themes/2015/03/03/handbook-examples-documentation/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/themes/2015/03/03/handbook-examples-documentation/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/themes/2015/03/03/handbook-examples-documentation/?share=bluesky)
 * [  Facebook ](https://make.wordpress.org/themes/2015/03/03/handbook-examples-documentation/?share=facebook)
 * [  X ](https://make.wordpress.org/themes/2015/03/03/handbook-examples-documentation/?share=x)
 * [  LinkedIn ](https://make.wordpress.org/themes/2015/03/03/handbook-examples-documentation/?share=linkedin)

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fthemes%2F2015%2F03%2F03%2Fhandbook-examples-documentation%2F%23respond&locale=en_US)

### Leave a Reply 󠀁[Cancel reply](https://make.wordpress.org/themes/2015/03/03/handbook-examples-documentation/?output_format=md#respond)󠁿

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fthemes%2F2015%2F03%2F03%2Fhandbook-examples-documentation%2F&locale=en_US)
to post a comment.

This site uses Akismet to reduce spam. [Learn how your comment data is processed.](https://akismet.com/privacy/)

# Post navigation

[← Theme review team weekly notes The logs are…](https://make.wordpress.org/themes/2015/03/03/theme-review-team-weekly-notes-the-logs-are-8/)

[Agenda for this week’s meeting We’ve got a… →](https://make.wordpress.org/themes/2015/03/09/agenda-for-this-weeks-meeting-weve-got-a-2/)