| @@ -65,21 +65,22 @@ | ||
| 65 | 65 | /** |
| 66 | 66 | * Function to get hooked into the `get_callback` property of the `parsely` |
| 67 | 67 | * REST API field. It generates the `parsely` object in the REST API. |
| 68 | 68 | * |
| 69 | - * @param array<string, mixed> $object_data The data of the object to render the metadata for, | |
| 70 | - * usually a post or a page. | |
| 69 | + * @param array<string, mixed> $object The WordPress object to extract to render the metadata for, | |
| 70 | + * usually a post or a page. | |
| 71 | + * | |
| 71 | 72 | * @return array<string, mixed> The `parsely` object to be rendered in the REST API. Contains a |
| 72 | 73 | * version number describing the response and the `meta` object |
| 73 | 74 | * containing the actual metadata. |
| 74 | 75 | */ |
| 75 | - public function get_callback( array $object_data ): array { | |
| 76 | + public function get_callback( array $object ): array { | |
| 76 | 77 | /** |
| 77 | 78 | * Variable. |
| 78 | 79 | * |
| 79 | 80 | * @var int |
| 80 | 81 | */ |
| 81 | - $post_id = $object_data['ID'] ?? $object_data['id'] ?? 0; | |
| 82 | + $post_id = $object['ID'] ?? $object['id'] ?? 0; | |
| 82 | 83 | $post = WP_Post::get_instance( $post_id ); |
| 83 | 84 | $options = $this->parsely->get_options(); |
| 84 | 85 | |
| 85 | 86 | if ( false === $post ) { |