[wp-hackers] getting user_id in buddypress profile page
BenderisGreat
greglancaster71 at gmail.com
Sat Oct 5 23:22:35 UTC 2013
This is likely very simple, but I am having an issue with it.
I am using
<?php
global $wpdb, $userdata, $current_user;
$current_user = wp_get_current_user();
$userid = $current_user->ID;
?>
I can echo out $userid and it shows the correct user ID, but when I put it
into the form submit;
$wpdb->insert(wp_jo_plugin_options, array (
'user_id' => $userid,
'length' => $_POST['length'],
'girth' => $_POST['girth'],
'date' => $_POST['date'],
it just posts a 0 to the database. Am I doing something wrong here? It
seems very straight forward, never had an issue with such a simple task.
But trying to add this code to buddypress is a real hassle.
--
View this message in context: http://wordpress-hackers.1065353.n5.nabble.com/getting-user-id-in-buddypress-profile-page-tp42444.html
Sent from the Wordpress Hackers mailing list archive at Nabble.com.
More information about the wp-hackers
mailing list