Problemns ins a Post’s Custom Field

Closed

Import WP Pro Updated 1 year ago 2 Replies

Davi asked 1 year ago on September 4, 2023 at 7:50 pm

Hello Everyone,

I am currently using the Newspaper Template v.12.5.1 by TagDiv on my WordPress v6.3.1. I’ve been attempting to import a post with both a “featured audio” and “featured video” using Import WP Pro. However, I’ve encountered a problem in step 3. Within the Custom Fields tab, I cannot locate the associated field name for “Featured Audio” or “Featured Video”. Upon inspecting the source code on the post editing page, I came across names like “td_post_audio”, “td_audio”, and “td_post_audio[td_audio]” and enabling the option “Enable Text Field”, but none of them seem to work. The desired field doesn’t appear in the select field for Custom Fields. Could anyone provide guidance on resolving this issue and successfully importing the “Featured Audio” field? I’ve attached some images for reference.

Thank you in advance

David

DC

Davi replied

1 year ago on September 4, 2023 at 9:01 pm

After further attempts and research, I discovered that the "Featured Audio" is registered in the "wp_postmeta" table under the "metakey" attribute = "td_post_audio", where the "meta_value" is a serialized data: a:1:{s:8:"td_audio";s:100:"url.mp3";}

How can I save this serialized value into the value of a custom field using ImportWP?

Thank you in advance

David

J

James replied Support Agent

1 year ago on September 5, 2023 at 9:02 pm

Hi David,

I have attached a custom plugin, that will modify the data stored in the td_post_audio custom field.

By adding a custom field with the name td_post_audio, and setting the field type to "Attachment", and the return value "Attachment URL - Single Record" (screenshot settings attached), once ran will conver the output from:

http://iwp274.local/wp-content/uploads/2023/09/medium_BARFCFD206_1656521323273-1.wav

To this:

"a:1:{s:8:"td_audio";s:84:"http://iwp274.local/wp-content/uploads/2023/09/medium_BARFCFD206_1656521323273-1.wav";}"