Skip to content

Instantly share code, notes, and snippets.

@azeemhassni
Last active January 1, 2017 07:38
Show Gist options
  • Save azeemhassni/2aeaaf69023a1049aabd35d07717d799 to your computer and use it in GitHub Desktop.
Save azeemhassni/2aeaaf69023a1049aabd35d07717d799 to your computer and use it in GitHub Desktop.
<?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