Timeline for Have save_post write to database image meta [closed]
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 8, 2012 at 18:55 | history | closed | Rarst | not a real question | |
Oct 4, 2012 at 8:49 | comment | added | kaiser | Could you please update your question with that info and clean up that comment mess (delete your own)? Thanks. | |
Mar 28, 2012 at 22:58 | comment | added | Pat | After a bit of a break from working on this, I am realizing that the code is being saved in a NEW meta_key which is naming it the value of $camera, and the meta_value of $_POST. So you're right, this IS working after all, however not how I want it to. Is there a way to update attachment meta? I think that's what I'm after - not POST meta. | |
Mar 8, 2012 at 2:14 | comment | added | Pat | Tried to print_r, but am not getting much since it's changing the page during the save/update. The debug info shows my $postID as the same as URL. Would it help if I shared the entire function? | |
Mar 7, 2012 at 12:52 | comment | added | mor7ifer |
Nope, nothing wrong with the code you posted so far as I can tell. Start doing print_r() s on everything and see what's falling apart.
|
|
Mar 7, 2012 at 3:40 | comment | added | Pat | Anything else come to mind? | |
Mar 5, 2012 at 18:07 | comment | added | Pat | Pretty sure. I have global $post defined in the function, and If I do $postID = $post->ID | echo $postID, it shows the same post ID as in the URL. | |
Mar 5, 2012 at 13:14 | comment | added | mor7ifer |
You're sure that $post->ID has a value? Are you sure it's even making it through the filters and such that should be in place to get to update_post_meta() ?
|
|
Mar 4, 2012 at 17:56 | comment | added | Pat | I'm editing another plugin which is open source under the GNU general public license. I've scanned it to find where it is defining $post_id, and came up blank. That said, I've changed my update_post_meta to update_post_meta($post->ID, $camera, $update);, and it's still not saving the value in the input box when I change it and update my post. | |
Mar 4, 2012 at 14:19 | comment | added | mor7ifer |
Where are yuo setting $post_id ? At this point, I see nothing inherently wrong with what you've got, so it may not be within the code you've posted.
|
|
Mar 4, 2012 at 14:13 | comment | added | Pat | Yes, this was a snippet. I can paste the whole thing if you feel its relevant. The foreach does not exist in my update_post_meta save_post. As I mentioned, I am able to extract data fine, I can't save it. | |
Mar 4, 2012 at 11:42 | comment | added | mor7ifer | So...there's more to the foreach than you posted here? | |
Mar 4, 2012 at 4:51 | comment | added | Pat | The foreach sets the values for the input box that's displayed in the add_meta_box. So if the values are changed, shouldn't the $POST_() pick that up? If so, then I am doing something wrong with the update_post_meta | |
Mar 4, 2012 at 0:22 | comment | added | mor7ifer |
What are you trying to do with that foreach ? You're setting those values a whole bunch of times, but not doing any output before you change them.
|
|
Mar 3, 2012 at 23:56 | history | edited | mor7ifer | CC BY-SA 3.0 |
added 6 characters in body
|
Mar 3, 2012 at 14:49 | history | tweeted | twitter.com/#!/StackWordPress/status/175956157633019904 | ||
Mar 3, 2012 at 3:43 | history | asked | Pat | CC BY-SA 3.0 |