
如何使用Varying Vagrant Vagrants (VVV) 进行WordPress开发
post_custom ( $key = '' )
post_custom: 这个函数用来检索具有指定ID的文章的自定义文章数据。
检索文章的自定义元数据字段。
function post_custom( $key = '' ) { $custom = get_post_custom(); if ( ! isset( $custom[ $key ] ) ) { return false; } elseif ( 1 === count( $custom[ $key ] ) ) { return $custom[ $key ][0]; } else { return $custom[ $key ]; } }