wp_post_revision_field_{$field}

過濾鉤子
apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' )
引數
  • (string) $revision_field The current revision field to compare to or from.
    Required:
  • (string) $field The current revision field.
    Required:
  • (WP_Post) $compare_from The revision post object to compare to or from.
    Required:
  • (string) $context The context of whether the current revision is the old or the new one. Values are 'to' or 'from'.
    Required:
定義位置
相關勾子
wp_post_revision_fieldswp_put_post_revisionwp_get_revision_ui_diffwp_save_post_revision_check_for_changeswp_delete_post_revision
相關方法
_wp_post_revision_fieldswp_post_revision_title_wp_post_revision_datawp_post_revision_title_expandedwp_get_post_revisions_urlwp_is_post_revision
引入
3.6.0
棄用
-

wp_post_revision_field_{$field}: 這是一個鉤子(hook),用於處理在文章版本系統中儲存的特定欄位。變數 $field 是用來指定特定欄位的字串。通過使用此鉤子,外掛和主題開發者可以在顯示文章版本資訊時自定義欄位的內容。

上下文過濾一個文章修訂欄位。

鉤子名稱的動態部分,$field,對應於修訂物件的一個欄位的名稱。

可能的鉤子名稱包括:

  • _wp_post_revision_field_post_title
  • _wp_post_revision_field_post_content
  • _wp_post_revision_field_post_excerpt
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : '';
$content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : '';
$content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : '';

常見問題

FAQs
檢視更多 >