Title: Postboxes not defined
Last modified: August 20, 2016

---

# Postboxes not defined

 *  [Rhand](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/postboxes-not-defined/)
 * Using this code [http://paste2.org/p/1464698](http://paste2.org/p/1464698) to
   load menu pages with one with a meta box in the admin. Somehow I keep on getting
   this JavaScript error
 *     ```
       [19:31:41.506] postboxes is not defined @ http://domain.com/wp-admin/admin.php?page=sub-page:131
       ```
   
 * Any ideas why this is?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/postboxes-not-defined/#post-2126758)
 * Comment out that `<script>...</script>` part and see if you get the error. It
   looks like you are printing javascript from a call to `add_sub_menu()`. I’m not
   sure that will work. That function isn’t really intended, as far as I understand
   it, to be echoing html/css/javascript.
 * Usually I would `wp_enqueue` my scripts rather than print them like that or print
   it from within a function– usually my own– that is printing markup.
 *  Thread Starter [Rhand](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/postboxes-not-defined/#post-2126828)
 * Thanks for the feedback. The script needed to work with the postboxes were not
   loaded properly because I did not call the proper action for it nor did I do 
   the call on time. Now reworking the code..
 *  [huntermaster](https://wordpress.org/support/users/huntermaster/)
 * (@huntermaster)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/postboxes-not-defined/#post-2126883)
 * I moved my <script> code to the wp-footer action and now i don’t get the error,
   but my boxes don’t open/close when i click them. How can i get boxes to toggle
   open & closed when i click the title?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Postboxes not defined’ is closed to new replies.

## Tags

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

 * 3 replies
 * 3 participants
 * Last reply from: [huntermaster](https://wordpress.org/support/users/huntermaster/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/postboxes-not-defined/#post-2126883)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
