require_once("../wp-load.php");
add_action( 'plugins_loaded', 'get_user_info' );
function get_user_info(){
$current_user = wp_get_current_user();
echo 'User display name: ' . $current_user->display_name . '<br />';
}
echo $return;
. Заменил на return $return;
. $author = get_posts( array( 'author' => 123, 'posts_per_page' => -1 ) );
foreach((array) $author as $post) {
setup_postdata($post);
the_title('<h2>', '</h2>');
the_content();
}
wp_reset_query();