WordPress functions – get values without echo

How can I programmatically use the data of the bult-in WordPress functions.

E.g. I’d like to use the data of

Read More
the_author_meta('login_name'); 

in a php function. Problem: The function echoes the value by default. In order to use the actual value in a function I can think of using an output buffer like …

ob_start();
the_author_meta('login_name');  
$contents = ob_get_contents();
ob_end_clean();

but I was hoping for a better (less bloated) solution.

Any idea how to get the echo values as simple return values instead?

Related posts

Leave a Reply

1 comment