Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@a3779fb from refs/heads/main
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed May 15, 2024
1 parent 1f5c219 commit db7a7e2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions includes/taxonomies/class-languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,15 @@ protected function recursively_search_for_block_attrs_and_return($block, $attrib

public function restfully_get_post_for_translation( \WP_REST_Request $request ) {
$post_id = $request->get_param( 'post_id' );
$blocks = $this->provide_object_for_translation($post_id);
return $blocks;
$to_return = [];
$to_return['entityId'] = $post_id;
$to_return['entityType'] = get_post_type($post_id);
$to_return['entityTranslatables'] = [
'title' => get_the_title($post_id),
'excerpt' => get_the_excerpt($post_id),
'blocks' => $this->provide_object_for_translation($post_id),
];
return $to_return;
}

public function provide_object_for_translation($post_id) {
Expand Down

0 comments on commit db7a7e2

Please sign in to comment.