diff --git a/modules/likes.php b/modules/likes.php index d74941fd10f6c..72bbf61994233 100644 --- a/modules/likes.php +++ b/modules/likes.php @@ -632,6 +632,10 @@ function jetpack_post_likes_register_rest_field() { // Add Likes post_meta to the REST API Post response. add_action( 'rest_api_init', 'jetpack_post_likes_register_rest_field' ); +// Some CPTs (e.g. Jetpack portfolios and testimonials) get registered with +// restapi_theme_init because they depend on theme support, so let's also hook to that +add_action( 'restapi_theme_init', 'jetpack_post_likes_register_rest_field', 20 ); + /** * Set the Likes and Sharing Gutenberg extension availability */ diff --git a/modules/sharedaddy/sharing.php b/modules/sharedaddy/sharing.php index f92e76d99171f..7b20d6952bced 100644 --- a/modules/sharedaddy/sharing.php +++ b/modules/sharedaddy/sharing.php @@ -610,6 +610,10 @@ function jetpack_post_sharing_register_rest_field() { // Add Sharing post_meta to the REST API Post response. add_action( 'rest_api_init', 'jetpack_post_sharing_register_rest_field' ); +// Some CPTs (e.g. Jetpack portfolios and testimonials) get registered with +// restapi_theme_init because they depend on theme support, so let's also hook to that +add_action( 'restapi_theme_init', 'jetpack_post_likes_register_rest_field', 20 ); + function sharing_admin_init() { global $sharing_admin;