meta_helper = $meta_helper; } /** * Renders the current value of a meta field for a post, with replacement variables resolved. * * @param int $post_id The ID of the post. * @param string $meta_key The meta key (without prefix) to render. * * @return string The rendered value. */ public function render( int $post_id, string $meta_key ): string { $value = (string) $this->meta_helper->get_value( $meta_key, $post_id ); return (string) \wpseo_replace_vars( $value, \get_post( $post_id ) ); } }