Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

c0nc3pt.SF on "update_post_meta returns true, but doesn't work."

$
0
0

Hi all,

Hitting a major brick wall using update_post_meta in a particular instance. I'm writing a plugin and am using the the method in various other parts of the plugin, but for some reason it's not working in this particular metabox.

Here is the textarea:
<textarea id="sb_tweetbox" name="sb_tweetbox"><?php get_post_meta('_sb_saved_tweet'); ?></textarea>

Here is the instance for calling update_post_meta:

add_action('save_post','twtSavePost');

function twtSavePost(){
	global $post;
update_post_meta($post->ID,'_sb_saved_tweet',$_POST['sb_tweetbox']);
}

I confirmed that the $_POST data was coming through and that $post->ID was correct by using wp_die to output it. I also confirmed that the save action is working this way. When I assign update_post_meta to a variable and output the result it comes back at "1", which should mean that it successfully added the data to the database. However, this is no the case.

I am using update_post_meta all throughout the plugin and in my theme as well and I can't seem to find out why this particular instance is "working" but not working. Any assistance would be appreciated.


Viewing all articles
Browse latest Browse all 8245

Trending Articles