[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/rest-api/fields/ -> class-wp-rest-revision-meta-fields.php (summary)

REST API: WP_REST_Revision_Meta_Fields class

File Size: 63 lines (2 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_REST_Revision_Meta_Fields:: (2 methods):
  get_value()
  get_registered_fields()


Class: WP_REST_Revision_Meta_Fields  - X-Ref

Core class used to read the meta values of post revisions via the REST API.

Only the meta keys that are revisioned for the parent post type are exposed,
because those are the only values that are stored on a revision. Any other
meta key registered for the post type would be read from the revision ID,
find nothing, and be reported with its default value instead.

get_value( $object_id, $request )   X-Ref
Retrieves the meta field values for a revision.

When an author autosaves their own draft, the autosaves controller updates
the post itself and returns it instead of an autosave. That post stores all
of its meta, so its values are read as regular post meta.

param: int             $object_id Object ID to fetch meta for.
param: WP_REST_Request $request   Full details about the request.
return: array Array containing the meta values keyed by name.

get_registered_fields()   X-Ref
Retrieves the registered meta fields that are revisioned for the parent post type.

return: array Registered fields, limited to the revisioned meta keys.



Generated : Tue Oct 27 08:20:35 2026 Cross-referenced by PHPXref