• b a

    (@mpa4hu)


    Hello, I run big multisite blog network with many users in it.

    I want to display on some place users 5 last visited blogs.
    Of course it is much easier to display it then actually storing it in db.

    I came up with code

    global $blog_id;
    	$current_blog_details = get_blog_details( array( 'blog_id' => $blog_id ) );
    
    	if (is_user_logged_in()) {
    	    $user = wp_get_current_user();
    	    update_user_meta($user->ID, 'last_visited_blogs',  $current_blog_details->blogname);
    	}

    it works perfect but saves only last blog.
    How to remake this code to save an array of blog names, or even IDs or anything, which later I can convert to blognames and is array of 5 visited blogs.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘users last visited blogs array’ is closed to new replies.