jreviews:listing:structured_data
Allows filtering and modifying the Schema.org structured data array before it's converted to JSON-LD format and added to the listing detail page. Use this to customize SEO structured data for better search engine visibility.
You need to have a working knowledge of Hooks before you get started.
Fires when adding Schema.org structured data to listing detail pages, after data is generated but before JSON-LD conversion
Parameters
| Name | Type | Description |
|---|---|---|
$schemaArray |
array |
The structured data array following Schema.org specifications, before JSON-LD conversion |
$listing |
\JReviews\App\Models\Listing |
The listing model being displayed |
Boilerplate Code
Use the boilerplate code to start using the filter, and add your own logic to modify the first argument and return it.
fwd_add_filter('jreviews:listing:structured_data', function($schemaArray, $listing)
{
// Your code here
return $schemaArray;
});
Source Files
app/Actions/AddListingDetailStructuredDataAction.php