我反复看到以下模式,on this site 在其他地方:
add_action( \'save_post\', \'wpse14169_save_post\' );
function wpse14169_save_post( $post_id )
{
if ( defined( \'DOING_AUTOSAVE\' ) && DOING_AUTOSAVE ) {
return $post_id;
}
// Other code...
}
我为什么要回来$post_id
? save_post
是一种行为the return value of an action handler is ignored. WordPress核心本身doesn\'t do it either.Codex示例does return the $post_id
, 但这不会是法典中第一条不正确(或过时)的行。
我错过了什么?我需要回去吗$post_id
? 有没有必要这样做?