SearchWP

This Documentation is for SearchWP Version 3

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

[wpforms id="3080"]