SearchWP Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP’s many hooks

searchwp\source\post\attributes\comments\author

Since: 4.0.0

Table of Contents

When Comments have been added to a WP_Post-based Source, control whether the Comment Author is indexed.

Parameters

Type Parameter Default Since
Boolean $enabled false 4.0.0
Array $args
Key Type Value
post_id Integer Post ID
4.0.0

Examples

All hooks should be added to your custom SearchWP Customizations Plugin.

Index Comment Authors

<?php
// Enble Comment Author indexing in SearchWP.
add_filter( 'searchwp\source\post\attributes\comments\author', function( $enabled, $args ) {
return true;
}, 10, 2 );

How to use this code