apply_filters( 'relevanssi_admin_search_element', string $post_element, object $post )
Filters the results the Relevanssi admin search finds.
Parameters
$post_element
(string) The HTML element for the post
$post
(object) The post object. Usually a WP_Post object, but can be a stdClass object for users and taxonomy terms.
More information
When Relevanssi admin search returns the results, the results are <li>
elements that have information about the posts. If you want to modify the results somehow, this filter hook can be used for that. As long as you return a <li>
element, feel free to modify the element as you wish.
The default element looks like this:
<li>Blog name: <strong>Post title</strong> (edit link) (pinning buttons)<br /> Post excerpt<br /> Score: post score (mention if the post is pinned)</li>
For example:
<li> <strong><a href="http://loyang.local/nam-quia-aut-dolorem-rerum/">Nam quia aut dolorem rerum post</a></strong> (<a href="http://loyang.local/wp-admin/post.php?post=6817&action=edit&lang=en">Edit post</a>) <button type="button" class="pin" data-postid="6817" data-keyword="dolorem">Pin for 'dolorem'</button> <br> <span class="excerpt_part">...molestias itaque. et ut ut sit ut consequatur. et ratione labore Repellat recusandae alias rerum ea animi Omnis facere omnis <span style="text-decoration: underline; text-color: #ff0000">doloremque dolorem</span> quae voluptatem. <span style="text-decoration: underline; text-color: #ff0000">Dolorem</span> saepe <span style="text-decoration: underline; text-color: #ff0000">dolorem</span> maiores atque dignissimos....</span><span class="excerpt_part">...Repellat minima asperiores sit rerum eius est est. Quasi aut est omnis laborum ipsum quis. Fugit adipisci alias earum <span style="text-decoration: underline; text-color: #ff0000">doloremque</span> est tempore. Dignissimos aut fugiat <span style="text-decoration: underline; text-color: #ff0000">dolorem</span> distinctio iusto. Est consequatur...</span><span class="excerpt_part">...eaque. Excepturi deserunt nesciunt in consequuntur id. Recusandae vero officia voluptate harum. Reprehenderit illo perferendis voluptas numquam debitis sit <span style="text-decoration: underline; text-color: #ff0000">doloremque</span>. Ex aliquid et ab distinctio. Vel hic exercitationem exercitationem soluta...</span><span class="excerpt_part">...est officia. Nam voluptatum incidunt ut est quas iure quia ea. Labore velit voluptatum nostrum accusamus assumenda iusto modi. Tempore et <span style="text-decoration: underline; text-color: #ff0000">dolorem</span> in enim. Doloribus ad qui cum temporibus sint....</span><span class="excerpt_part">...pariatur et voluptates. Molestiae dolorum id non. Non voluptatem odio laboriosam Voluptas sit aut autem Labore aut maxime ut quas voluptas <span style="text-decoration: underline; text-color: #ff0000">Dolorem</span> accusantium sit voluptatem quia Optio iusto quasi pariatur...</span><br> Score: 8478.2 </li>