For an existing custom_user_meta="user_name" how can i create a permalink for post submitted by that user in the URL.
e.g. - for user_name="srk489" i want the permalink of the post "post1" posted by that user to be "http://localhost/srk489/post1".
To get the user meta i got the following function
get_user_meta($user_id, $key, $single);
When i searched i got the following code for adding custom post field in permalink
function custom_post_title($title) {
global $post;
$type = get_post_type($post->ID);
if ($type== 'post') {
$title = $post->post_title;
$custom_field_title = get_post_meta($post->ID, 'custom_post_title', true);
if(isset($custom_field_title))
return $title.'-'.$custom_field_title;
else
return $title;
}
return $title;
}
add_filter ('title_save_pre','custom_post_title');
How do i relate the user meta and post permalink with each other so that i can get user_meta as permalink?