At the end of 2023, we released a new version for our WordPress Plugin.
The new global export (or: global webhook) is a fundamental shift in how we connect to WordPress.
Until now, it was assigned to a specific platform and received only data once the story was assigned to this platform (you can still choose that basic option, if you want to). The new solution sends data over to WordPress no matter what platform it is assigned to. This makes it possible, for instance, to retrieve and use data for print or for other channels.
You can compare it, metaphorically, to a cake. If you only want a single, specific piece of the cake, use the simple ("basic") platform-specific export. On the other hand, if you want the whole cake, so that you can distribute all the slices yourself, then the global export is the right solution for you.
Additional features of the new plugin version
- Global export function > We now enable a global export from Desk-Net to WordPress. The transferred Desk-Net story potentially contains all data fields of a Desk-Net entry, and thus much more than in the basic, channel-specific export requests. In addition, WordPress automatically recognizes the "main publication" in Desk-Net.
- Custom field synchronization > We added a new logic for synchronizing custom fields. This logic allows Desk-Net's field types Text and Single Select to be mapped to a custom meta field on WordPress and synchronized with it.
- Initial status synchronization > When a user creates a new post on WordPress, the Desk-Net status field is synchronized once. The logic is identical to the slug field.
How to deal with it
You cannot use both integration forms at the same time. However, there is no obligation to update the WordPress plugin. In practice, there will be a transition period during which both versions will be used:
- For customers who are already using the previous integration and do not wish to update, nothing will change. They can continue to use the previous plugin as usual and without complications.
- Customers who wish to install the basic, platform-specific WordPress plugin can do so as follows:
Setting up the WordPress Plugin
- Customer, who want to use the global export: We need to activate this export for you first. To do so, we need various details about your Desk-Net account and the platform that you want to be connected. Please contact us: email@example.com.
- Also for customers who have been using the previous basic solution and would like to switch to the new global webhook, for the time being we recommend contacting us first: firstname.lastname@example.org.
For developers: WordPress global export integration
Desk-Net sends to WordPress the global export requests when Desk-Net users create/update a Story in the Desk-Net application. The global export integration contains more data in the request object than basic (platform-specific) integration.
The Desk-Net plugin contains next API endpoints for work with Global Export requests:
1) For action Create: YOUR_DOMAIN_NAME/wp-json/wp-desk-net/v1/element
- Method: POST
2) For action Update: YOUR_DOMAIN_NAME/wp-json/wp-desk-net/v1/element/(?P<post_id>\d+)
- Method: PUT
- (?P<post_id>\d+) - it's the Post ID in WordPress which will be updated
What does the Desk-Net plugin do with this data?
The Desk-Net plugin finds the main publication platform by "ID" and by "globalExportPublication" flag. Then the Desk-Net plugin syncs the "category", "status" and "date" fields for the main publication.
Also, other fields, that do not depend on the main publication, will be synced (slug, tasks, etc.).
The additional data, that the WordPress Desk-Net plugin gets from the Desk-Net API, will be ignored, but you can use them in your WordPress if needed.
How can developers get the global export data to work with it?
The Desk-Net plugin contains two filters that you can use to modify or get/read the story data which sent by the Desk-Net API.
apply_filters( 'wp_desk_net_insert_post', $post_data,
‘wp_desk_net_insert_post’ – this filter name contains two variables and will be called when a story is created in the Desk-Net application:
- $post_data is the data which the Desk-Net plugin will use to create a post.
- $data_from_desk_net is the global export data obtained from the Desk-Net API.
apply_filters( 'wp_desk_net_update_post', $post_data,
‘wp_desk_net_update_post’ – this filter name contains two variables and will be called when a story is updated in the Desk-Net application
- $post_data is the data which the Desk-Net plugin will use to update a post.
- $new_story_data is the global export data that was obtained from the Desk-Net API.
What to consider / FAQ
- Can I use the platform-specific as well as the global export simultaneously for one platform?
It's not possible to use the Global Export function and the Basic WordPress synchronization for a single platform in Desk-Net at the same time. It is therefore either the basic plugin or the new one.
- Customers can have several WordPress basic (platform-specific) exports to individual platforms. Like: platform A > export to WordPress website 1; platform B > export to WordPress site 2, etc.
Can I assign multiple WordPress global exports? Each connected to another platform?
No, at the moment, one organization can have only one global export connection per organization. That means: it's not possible for a Desk-Net story to contain a global export syncing for more than one platform.
For the future, we're working on the ability to support more than one platform, so organizations can set up multiple connections.
Example of a JSON Data of a story sent by Desk-Net global export API into WordPress (created for an internal test account - all names are abitrary):