post_custom_meta_box()

 

File: wp-admin/includes/meta-boxes.php

function post_custom_meta_box( $post ) {
	?>
<div id="postcustomstuff">
<div id="ajax-response"></div>
	<?php
	$metadata = has_meta( $post->ID );
	foreach ( $metadata as $key => $value ) {
		if ( is_protected_meta( $metadata[ $key ]['meta_key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ]['meta_key'] ) ) {
			unset( $metadata[ $key ] );
		}
	}
	list_meta( $metadata );
	meta_form( $post );
	?>
</div>
<p>
	<?php
	printf(
		/* translators: %s: Codex URL */
		__( 'Custom fields can be used to add extra metadata to a post that you can <a href="%s">use in your theme</a>.' ),
		__( 'https://codex.wordpress.org/Using_Custom_Fields' )
	);
	?>
</p>
	<?php
}

参数:post_custom_meta_box( object $post )

$post

(object)
(Required)

{acontent3}

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

50.00% (4) 次Baidu访问
12.50% (1) 次Google访问
37.50% (3) 次Sogou访问
  • 蜘蛛:Baidu,4次,更新时间:2019-05-14 23:49:07
  • 蜘蛛:Google,1次,更新时间:2019-05-13 01:10:50
  • 蜘蛛:Sogou,3次,更新时间:2019-05-04 12:10:42

参与评论