Skip to main content
View Categories

homerunner_quote_data

< 1 min read

To modify the quote data before it is served to the user, you can use the `homelocal_quote_data` filter. This filter allows you to modify the quote data array before it is returned.

add_filter( 'homelocal_quote_data', function( $data ) {
	if (! empty($data['rateplans'])) {
		foreach ($data['rateplans'] as &$rateplan) {
			// Example: Change description of rateplan with title 'Default'
			if ('Default' === $rateplan['title']) {
				$rateplan['description'] = 'This is a default title';
			}
		}
	}

	return $data;
});