Note: You are viewing the documentation for Version 3View Version 4 Docs

Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

Available since: 3.0

searchwp_th_password_required_message

View Parameters »

When highlighting is enabled and SearchWP finds a password protected entry, it will return a default message as opposed to finding an excerpt with a highlight. You can use this hook to customize that returned message:

<?php
// Customize the 'password protected' message returned by SearchWP's highlighter.
add_filter( 'searchwp_th_password_required_message', function( $message ) {
return __( 'There is no excerpt because this is a protected post.' );
} );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$message String

The message to return when an entry is password protected

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP