Last active
January 1, 2017 07:38
-
-
Save azeemhassni/2aeaaf69023a1049aabd35d07717d799 to your computer and use it in GitHub Desktop.
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 | |
# include this file in theme's functions.php | |
namespace Timber { | |
/** | |
* Proxy \get_post_meta to ACF get_field function | |
* | |
* @param $id | |
* @param $field_name | |
* @return mixed | |
*/ | |
function get_post_meta( $id, $field_name ) | |
{ | |
if (function_exists('get_field')) { | |
return get_field($field_name, $id); | |
} | |
return \get_post_meta($id, $field_name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment