I am trying to write a function that will allow me to specify a post ID and a blog ID, and then have it return the permalink and title of the blog post.
I need this to be efficient because the function will be used in a foreach loop that could cause the function to run upwards of 50 times.
Any ideas?
That sounds pretty simple.
Use: http://codex.wordpress.org/Function_Reference/switch_to_blog
To go back use:
restore_current_blog();
This allows you to switch from site to site.
Then: http://codex.wordpress.org/Function_Reference/get_permalink
My assumptions are that you have both the Blog ID and the Post ID.
If that’s the case – using those two functions should solve your problem.