post_custom()

 

File: wp-includes/post-template.php

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 ];
	}
}

参数:post_custom( string $key = '' )

Meta data key name.

(false string array)值数组或单个值(如果只存在一个元素)。如果键不存在,则返回false。

$key

(string)
(Optional)
Meta data key name.

Default value: ''

{acontent3}

You must log in before being able to contribute a note or feedback.

13.33% (2) 次Baidu访问
6.67% (1) 次Google访问
73.33% (11) 次Sogou访问
6.67% (1) 次sm访问
  • 蜘蛛:Baidu,2次,更新时间:2019-04-26 02:16:01
  • 蜘蛛:Google,1次,更新时间:2019-05-10 15:06:42
  • 蜘蛛:Sogou,11次,更新时间:2019-05-21 18:12:12
  • 蜘蛛:sm,1次,更新时间:2019-05-13 18:34:26

参与评论