public static function get_field_value_by_store($store_type, $name, $id = null)
{
$args = array($id, $name, true);
$function = '';
switch ($store_type) {
case 'post_meta':
$function = 'get_post_meta';
break;
case 'user_meta':
$function = 'get_user_meta';
break;
case 'comment_meta':
$function = 'get_comment_meta';
break;
case 'term_meta':
$function = 'get_metadata';
$args = array('term', $id, $name, true);
break;
case 'theme_options':
$function = 'get_option';
$args = array($name);
break;
}
if (!empty($function) && function_exists($function)) {
return call_user_func_array($function, $args);
}
return false;
}