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 Kordiam to WordPress. The transferred Kordiam story potentially contains all data fields of a Kordiam entry, and thus much more than in the basic, channel-specific export requests. In addition, WordPress automatically recognizes the "main publication" in Kordiam.
-
Custom field synchronization > We added a new logic for synchronizing custom fields. This logic allows Kordiam'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 Kordiam 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 Kordiam account and the platform that you want to be connected. Please contact us: support@kordiam.io.
- 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: support@kordiam.io.
For developers: WordPress global export integration
Kordiam sends to WordPress the global export requests when Kordiam users create/update a Story in the Kordiam application. The global export integration contains more data in the request object than basic (platform-specific) integration.
The Kordiam 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 Kordiam plugin do with this data?
The Kordiam plugin finds the main publication platform by "ID" and by "globalExportPublication" flag. Then the Kordiam 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 Kordiam plugin gets from the Kordiam 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 Kordiam plugin contains two filters that you can use to modify or get/read the story data which sent by the Kordiam API.
Create Story:
apply_filters( 'wp_desk_net_insert_post', $post_data,
$data_from_desk_net );
‘wp_desk_net_insert_post’ – this filter name contains two variables and will be called when a story is created in the Kordiam application:
- $post_data is the data which the Kordiam plugin will use to create a post.
- $data_from_desk_net is the global export data obtained from the Kordiam API.
Update Story:
apply_filters( 'wp_desk_net_update_post', $post_data,
$new_story_data );
‘wp_desk_net_update_post’ – this filter name contains two variables and will be called when a story is updated in the Kordiam application
- $post_data is the data which the Kordiam plugin will use to update a post.
- $new_story_data is the global export data that was obtained from the Kordiam 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 Kordiam 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 Kordiam 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.
Sample file
Example of a JSON Data of a story sent by Kordiam global export API into WordPress (created for an internal test account - all names are abitrary):
Comments
0 comments
Please sign in to leave a comment.