| 开发者 | naiches |
|---|---|
| 更新时间 | 2026年9月15日 00:31 |
| PHP版本: | 8.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
voertuig schema, exactly as the feed sends them.
$vehicle = mobilox_get_vehicle();
echo esc_html( $vehicle->merk . ' ' . $vehicle->model );
Or field by field, using dot notation for nested elements:
echo esc_html( mobilox_get_field( 'bouwjaar' ) );
echo esc_html( mobilox_get_field( 'tellerstand' ) );
echo esc_html( mobilox_get_field( 'verkoopprijs_particulier.bedrag' ) );
Both helpers default to the current post in the loop, and accept a post ID as a second argument. To see exactly which fields your own feed delivers, open a synced vehicle in the editor and look at the Mobilox Vehicle Data meta box.
/wp-content/plugins/ or install via Plugins → Add New.If your theme already has a vehicle/occasion post type, select that. Otherwise, use the built-in "Mobilox Vehicle" type. You can change this at any time — existing vehicles will continue to work.
Use mobilox_get_vehicle( $post_id ) to get the full data object, or mobilox_get_field( 'merk' ) for a single field. Field names match the Dutch Mobilox DV XML element names (e.g. merk, model, bouwjaar, tellerstand), and dot notation reaches nested elements (e.g. verkoopprijs_particulier.bedrag). The Mobilox Vehicle Data meta box on any synced vehicle lists every field your feed actually sends.
Before this release, a site that never had a token configured had an open sync endpoint. The update generates a token for you and closes the endpoint, which changes the endpoint URL. Copy the new URL from Mobilox → Dashboard into your DV configuration. The plugin shows a notice on its own pages until you confirm you have done so.
Yes. Mobilox pushes without a WordPress login, so plugins that reject all anonymous REST requests would normally block it. This plugin lets a request through that lock-down only when it is addressed to the sync route and carries valid credentials; everything else stays blocked.
The endpoint requires authentication. Activation generates a secret token for you: copy it from Settings into Mobilox, or replace it with HTTP Basic Auth credentials. Requests without valid credentials are rejected.
mobilox_get_vehicle() and mobilox_get_field() were not actually available to themes, so following the documentation caused a fatal error. They now exist as documented, and mobilox_get_field() can reach nested fields such as verkoopprijs_particulier.bedrag. The readme examples have been corrected to the real Dutch field names.mobilox_get_field() calls in a theme loop now reuse one decoded copy of the vehicle data per request instead of querying and decoding for every call.verkoopprijs_particulier → prijs → bedrag), but the DV schema places it directly at verkoopprijs_particulier → bedrag, so prices were stored as 0. The price is now read from the correct element, with a fallback for feeds that wrap it in a <prijs> node.opmerkingen) is now saved to the post content, so themes that render the_content() show the full description.<titel> element.voertuig.xsd (2.21) element names — voertuignr_hexon, merk, model, tellerstand, verkoopprijs_particulier, afbeeldingen, verkocht — so make, model, price, mileage, fuel, build year, sold status, and photos are stored correctly."1"), which the DV client rejected as "Answer unequal to '1'" — every push was reported as failed even when the vehicle was stored. The endpoint now returns a bare 1 / 0.post_type, which shadows a reserved WordPress admin request variable used to resolve the current admin page, making the page-hook lookup fail on save. All settings fields are now plugin-prefixed so they can't collide with core request vars or other plugins.