Add data attribute of post_id for Internal links

I noticed that internal links to other posts have data- * Attribute.

One of Post ID. And the other of Post Type.

(As in screenshot).

The problem is, it's only in the block editor (Gutenberg). And not in the classic editor.

The question is, is it possible to add this data, even in the classic editor.

Thank you.

I want, When the mouse goes over a link. An AJAX request will be made, with the post ID data. Then WordPress in response will return the content of the post. (Using get_post etc.) Then present it to the user as a Tooltip. (As in Wikipedia.)

Thanks.

Topic block-editor post-content links posts Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.