Last active
August 29, 2015 13:55
-
-
Save yuka2py/8698134 to your computer and use it in GitHub Desktop.
WordPress の the_*() 関数で出力される値を、文字列として取得する簡単な関数。要るのかな?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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