Skip to main content
added 6 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251

Answer to this question actually comes from @TomJNowell. Instead of using mysqlMySQL calls, use the native functions included with WordPress.:

update_post_meta ( $post->ID , 'forum_id', $thread_id );

update_post_meta ( $post->ID , 'forum_id', $thread_id );

where the forum_idforum_id is the key and the $thread_id$thread_id is the value. I tried add_post_meta but that created duplicates.

To retrieve the meta data

$thread_id = get_post_custom_values( 'thread_id', $post->ID);

Now I'm looking at ways to add to the comment meta. Hopefully this helps someone else.

Answer to this question actually comes from @TomJNowell. Instead of using mysql calls, use the native functions included with WordPress.

update_post_meta ( $post->ID , 'forum_id', $thread_id );

where the forum_id is the key and the $thread_id is the value. I tried add_post_meta but that created duplicates.

To retrieve the meta data

$thread_id = get_post_custom_values( 'thread_id', $post->ID);

Now I'm looking at ways to add to the comment meta. Hopefully this helps someone else.

Answer to this question actually comes from @TomJNowell. Instead of using MySQL calls, use the native functions included with WordPress:

update_post_meta ( $post->ID , 'forum_id', $thread_id );

where the forum_id is the key and the $thread_id is the value. I tried add_post_meta but that created duplicates.

To retrieve the meta data

$thread_id = get_post_custom_values( 'thread_id', $post->ID);

Now I'm looking at ways to add to the comment meta. Hopefully this helps someone else.

Source Link
LPH
  • 808
  • 1
  • 11
  • 25

Answer to this question actually comes from @TomJNowell. Instead of using mysql calls, use the native functions included with WordPress.

update_post_meta ( $post->ID , 'forum_id', $thread_id );

where the forum_id is the key and the $thread_id is the value. I tried add_post_meta but that created duplicates.

To retrieve the meta data

$thread_id = get_post_custom_values( 'thread_id', $post->ID);

Now I'm looking at ways to add to the comment meta. Hopefully this helps someone else.