Retrieve user meta data
-
Hello! How can I use WPUM users meta data outside plugins templates?
For example I can use something like get_user_meta($data->user->ID, ‘first_name’, true ); while im customizing profile.php template, but if i want yo use it in a filter in my functions.php, how can I take that profile page data?
Im want to filter the public profile meta title from functions.php, so I’m trying something like this:
function my_title_filter($title) {
$first_name = get_user_meta($data->user->ID, ‘first_name’, true );//The page where [wpum_profile] is
if (is_page(‘3038’)) {
$title = $first_name;
}
return $title;
}
add_filter(‘pre_get_document_title’, ‘my_title_filter’, 99);
The topic ‘Retrieve user meta data’ is closed to new replies.