searchwp\source\post\attributes\comments\args
Seit: 4.0.0
Steuern Sie die Argumente, die zum Abrufen von Kommentaren für einen Beitrag während der Indizierung verwendet werden.
Parameter
| Typ | Parameter | Standard | Seit | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Array | $comments_args |
Array mit definierter post_id Code für den aktuellen Beitrag |
4.0.0 |
||||||
| Array |
$args
|
4.0.0 |
|||||||
Beispiele
All hooks should be added to your custom SearchWP Customizations Plugin.
Nicht genehmigte Kommentare beim Indexieren einschließen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Include unapproved comments when SearchWP indexes. | |
| add_filter( 'searchwp\source\post\attributes\comments\args', function( $comment_args, $args ) { | |
| $args['include_unapproved'] = true; | |
| return $args; | |
| }, 20, 2 ); |

