protected get_post_custom ( integer $pid ) : array | ||
$pid | integer | |
return | array |
protected function get_post_custom($pid)
{
apply_filters('timber_post_get_meta_pre', array(), $pid, $this);
$customs = get_post_custom($pid);
if (!is_array($customs) || empty($customs)) {
return array();
}
foreach ($customs as $key => $value) {
if (is_array($value) && count($value) == 1 && isset($value[0])) {
$value = $value[0];
}
$customs[$key] = maybe_unserialize($value);
}
$customs = apply_filters('timber_post_get_meta', $customs, $pid, $this);
return $customs;
}