SearchWP Documentation

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

searchwp\query\result\load_data

Since: 4.0.0

Table of Contents

Control whether SearchWP loads applicable Entry Attribute data for search results.

Note: When this functionality is enabled, only the Attribute data added to the Engine will be loaded. See also searchwp\query\result\load_data\all_attributes

Parameters

Type Parameter Default Since
Boolean $enabled false 4.0.0
Array $args
Key Type Value
source String Source name of result
id String ID of result
query \SearchWP\Query The Query for this search
4.0.0

Examples

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

Load Source Attribute data for search result

<?php
// Load Source Attribute data for SearchWP search results.
add_filter( 'searchwp\query\result\load_data', function( $enabled, $args ) {
return true;
}, 30, 2 );

How to use this code