Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WordPress の the_*() 関数で出力される値を、文字列として取得する簡単な関数。要るのかな?
<?php
if ( ! function_exists( 'get_the' ) ) {
function get_the( $func ) {
$func = 'the_' . $func;
$args = func_get_args();
array_shift($args);
ob_start();
call_user_func_array( $func, $args );
return ob_get_clean();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment