SearchWP

This Documentation is for SearchWP Version 3

Available since: 2.5

searchwp_failed_index_notice

By default SearchWP will output a notice in the admin if it detects that any posts have failed to be indexed. Depending on your configuration, the notice may be shown to users who do not have the ability to edit those posts. The intention of the notice is to allow these Users the ability to let someone who can make the edit know, but you may wish to hide this notice if the User cannot do anything about it.

To conditionally prevent the ‘failed index’ notice from appearing for the current user, add something like the following to your theme’s functions.php:

<?php
function my_searchwp_failed_index_notice( $show_notice ) {
// TODO: set $show_notice to false if you want to prevent the notice from showing
return $show_notice;
}
add_filter( 'searchwp_failed_index_notice', 'my_searchwp_failed_index_notice' );
view raw gistfile1.php hosted with ❤ by GitHub