Title: add_action anonymous callback function
Last modified: August 20, 2016

---

# add_action anonymous callback function

 *  Resolved [Frumph](https://wordpress.org/support/users/frumph/)
 * (@frumph)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/add_action-anonymous-callback-function/)
 *     ```
       $output = 'freak';
       if (!empty($output)) add_action('wp_head', function() { echo $output; });
       ```
   
 * The anonymous callback function with the add_action makes my site die, erm white
   screen death.
 * Anyone familiar with this functionality know what the problem would be?
 * [http://codex.wordpress.org/Function_Reference/add_action](http://codex.wordpress.org/Function_Reference/add_action)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Frumph](https://wordpress.org/support/users/frumph/)
 * (@frumph)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/add_action-anonymous-callback-function/#post-3288643)
 * apparently this is a PHP 5.3 only thing, and is now removed from the codex
 * nothing to see here, move along ;/

Viewing 1 replies (of 1 total)

The topic ‘add_action anonymous callback function’ is closed to new replies.

## Tags

 * [add_action](https://wordpress.org/support/topic-tag/add_action/)

 * 1 reply
 * 1 participant
 * Last reply from: [Frumph](https://wordpress.org/support/users/frumph/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/add_action-anonymous-callback-function/#post-3288643)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
