wp_untrash_post_set_previous_status

函式
wp_untrash_post_set_previous_status ( $new_status, $post_id, $previous_status )
引數
  • (string) $new_status The new status of the post being restored.
    Required:
  • (int) $post_id The ID of the post being restored.
    Required:
  • (string) $previous_status The status of the post at the point where it was trashed.
    Required:
返回值
  • (string) The new status of the post.
定義位置
相關方法
wp_untrash_post_commentswp_transition_post_statuswp_untrash_postwp_trash_post_commentswp_get_post_revisions_url
引入
5.6.0
棄用
-

wp_untrash_post_set_previous_status: 這個函式設定一個被銷燬的文章的先前狀態,其他函式用它來確定這個文章在被銷燬之前的狀態。

過濾器的回撥,將一個未廢止的文章的狀態設定為之前的狀態。

這可以作為`wp_untrash_post_status`過濾器的一個回撥。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_untrash_post_set_previous_status( $new_status, $post_id, $previous_status ) {
return $previous_status;
}
function wp_untrash_post_set_previous_status( $new_status, $post_id, $previous_status ) { return $previous_status; }
function wp_untrash_post_set_previous_status( $new_status, $post_id, $previous_status ) {
	return $previous_status;
}

常見問題

FAQs
檢視更多 >