Opened 15 years ago
Closed 15 years ago
#14956 closed defect (bug) (invalid)
Fatal Error: add_meta_box
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0.1 |
Component: | Plugins | Keywords: | fatal error add_meta_box |
Focuses: | Cc: |
Description
I got this error when I was writting a plugin
Fatal Error: Call to undefined function add_meta_box()
I'm calling the function from the main plugin's php file and I had no problems with other wordpress functions, I've copied a sample code from Wordpress codex but it didn't worked. I read some post that said in wordpress 3.01 the problem was fixed but I'm using that version.
Sorry for my bad english.
Change History (1)
Note: See
TracTickets for help on using
tickets.
The file that contains add_meta_box() is not loaded at that point.
You need to hook into 'admin_menu' like the Codex suggests or even better in 'add_meta_boxes'.