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更容易处理信息。

过滤修订屏幕上使用的修订数组。

$revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );

常见问题

FAQs
查看更多 >