relevanssi_get_the_title( int|WP_Post $post )

Retrieves the post title with the Relevanssi highlighting applied to it.

Source: /lib/utils.php (/lib/common.php before 2.12.3 / 4.10.3)


(int|WP_Post) The post ID or the post object to use.


A string containing the post title with the Relevanssi highlights applied.


The functions works like get_the_title(), but uses the title with Relevanssi highlights included from $post->post_highlighted_title, if one is available (if not, the function falls back to $post->post_title).

Unlike get_the_title(), this function does not support using the global $post: you must supply the post ID parameter. For a version that can be used inside a Loop, you can use relevanssi_the_title() (which can be used to return the title, not just echo it).