Custom Field Synchronization Issue

  • Posted 2 months ago

Hello,

We are trying to synchronize content between two custom post types, “post-video” and “post” (News). The automatic post creation and basic field copying work correctly (title, content, featured image, and the video url meta field).

However, we are running into an issue when copying the value of the custom field “post-relation”, which is configured as a Dropdown Menu (Select) in the post editing screen.

To fix the synchronization, we need to know the exact database storage details for this field. Could you please provide the following information regarding the post-relation field on the post (News) post type?

1. The Exact Meta Key
What is the exact Meta Key used in the wp_postmeta table to store the value of the “post-relation” Dropdown Menu field?

Context: We are currently using the key post-relation in the code, but we suspect the actual database key is prefixed (e.g., _vxl_post-relation or voxel_post-relation). We need the precise string.

2. The Required Storage Format
When using the native WordPress function update_post_meta() for this “post-relation” field, what is the required format for the value?

Context: Does the field expect the selected value to be saved as:

A. A simple string or integer (e.g., ‘value_chosen’).

B. A serialized PHP array (e.g., array(‘value_chosen’)).

Once we have the exact Meta Key and the required Storage Format, we can finalize the synchronization script.

Thank you for your help!