Skip to main content

Timeline for Metabox doesn't retain values

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
Feb 29, 2012 at 16:19 vote accept Christopher
Feb 24, 2012 at 13:24 comment added Stephen Harris See updated answer. Also get_post_meta($postid,'_my_meta',TRUE); doesn't return an array. get_post_meta($postid,'_my_meta',FALSE); does, but not the one you're thinking.
Feb 24, 2012 at 13:11 comment added Christopher Is not showing up on refresh and that's why I've assumed that and then, after Stephen's help I've realised the data doesn't get saved.. then, I get the values in meta.php directly: <input type="text" name="_my_meta[title]" value="<?php if(!empty($meta['title'])) echo $meta['title']; ?>"/>, do I have to define $meta in meta.php?
Feb 24, 2012 at 12:32 comment added helgatheviking are you sure that the data isn't saving, or is it just not showing up in the metaboxes on refresh? that could be an issue w/ your meta.php. is $meta defined in meta.php?
Feb 24, 2012 at 11:18 answer added Stephen Harris timeline score: 0
Feb 24, 2012 at 11:06 comment added Christopher Yes @StephenHarris, it doesn't cause issues as it loads, otherwise my php file wouldn't show up in the admin section, right? As for the error, this is the first time I am using wp_die() and wp_die('message') will show me "message" as expected. This line instead: wp_die( '<pre>' . var_export( $post, true ) . '</pre>' ); will show me NULL, if placed before function or in the beggining, but after return, it shows nothing.
Feb 24, 2012 at 10:40 comment added Stephen Harris Could you try to see why the meta is not saving. I.e. in your checks in my_meta_save, on failure, die with some message: wp_die('Reason for failure') to determine which check you are failing on. Also, you should check its not an auto-save routine.
Feb 24, 2012 at 10:36 history edited Christopher CC BY-SA 3.0
added 309 characters in body
Feb 24, 2012 at 10:35 comment added Stephen Harris Probably not causing the issue but in anycase you should really use get_template_directory(); to get the Parent theme's directory (and get_stylesheet_directory() if you are after the child theme directory). See Codex.
Feb 24, 2012 at 10:20 history asked Christopher CC BY-SA 3.0