wp_prepare_revision_for_js

過濾鉤子
apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post )
引數
  • (array) $revisions_data { The bootstrapped data for the revisions screen. @type int $id Revision ID. @type string $title Title for the revision's parent WP_Post object. @type int $author Revision post author ID. @type string $date Date the revision was modified. @type string $dateShort Short-form version of the date the revision was modified. @type string $timeAgo GMT-aware amount of time ago the revision was modified. @type bool $autosave Whether the revision is an autosave. @type bool $current Whether the revision is both not an autosave and the post modified date matches the revision modified date (GMT-aware). @type bool|false $restoreUrl URL if the revision can be restored, false otherwise. }
    Required:
  • (WP_Post) $revision The revision's WP_Post object.
    Required:
  • (WP_Post) $post The revision's parent WP_Post object.
    Required:
定義位置
相關勾子
wp_prepare_themes_for_jspre_prepare_themes_for_jsrest_prepare_revisionwp_post_revision_fieldswp_restore_post_revision
相關方法
wp_prepare_revisions_for_jswp_prepare_themes_for_jswp_prepare_attachment_for_jswp_ajax_get_revision_diffs_wp_post_revision_fieldswp_restore_post_revision
引入
4.4.0
棄用
-

wp_prepare_revision_for_js: 這是一個鉤子(hook),用於在向JavaScript傳遞文章版本資訊之前對其進行預處理。通過使用此鉤子,外掛和主題開發者可以在傳遞版本資訊到JavaScript之前對其進行修改,以使JavaScript更容易處理資訊。

過濾修訂螢幕上使用的修訂陣列。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );
$revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );
$revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );

常見問題

FAQs
檢視更多 >