Created
April 2, 2012 10:10
-
-
Save colinbm/2282350 to your computer and use it in GitHub Desktop.
Class to wrap WordPress functions and return instead of echo
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 | |
class WpGet { | |
public static function __callStatic($name, $args) { | |
if (function_exists($name)) { | |
ob_start(); | |
$name($args); | |
$result = ob_get_contents(); | |
ob_end_clean(); | |
return $result; | |
} | |
return false; | |
} | |
} | |
$title = WpGet::single_tag_title(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment