Skip Navigation

[Resolved] Is there a way to work with custom date fields from another plugin?

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 7 years ago.

Assisted by: Nigel.

Author
Posts
#599086

Tell us what you are trying to do? Format a stored date value from a custom field created by another plugin. I see the field in the _postmeta table. Thought there ought to be a way to read it into a view. Maybe not?

Is there any documentation that you are following?

Is there a similar example that we can see?

This: [wpv-post-field name='_pp_editorial_meta_date_first-draft-date']
produces: 1513276182

This produces nothing
[types field='_pp_editorial_meta_date_first-draft-date' style='text' format='F j, Y'][/types]

We have a similar request about Updating and Creating, also, but need to know if we can display the value, first.

Thanks.

What is the link to your site?

#599188

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jerry

You can work with fields from another plugin—except when they are hidden fields (meaning, their name begins with an underscore).

On the page Toolset > Post Fields there is a button at the bottom "Post Field Control" which can be used to bring a custom field from another plugin under Types control, but not fields which are hidden.

The wpv_post_field shortcode outputs the raw value as stored in the database of any field if it exists, even hidden fields.

I think you will need to register a custom shortcode to output the field in the format you require.

You'll probably want to pass the field name as an attribute, get the corresponding post meta for the current post, convert the timestamp to a string in the required format using the PHP date() function, and return that.

If you need help with that, let me know.

#599387

Thanks very much!

This shows we can, in principle, achieve our goal which is to display and update certain values in the other plugin from our Toolset app (Am I correct?).

I will give it a try and let you know if I need help. May take several days before I get back to you.

jb

#599737

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Yes, you can read custom fields from other plugins.

If you want to write custom fields from other plugins, i.e. using a CRED form, then you would need to insert a generic field with the field slug and you would need to add the "persist":1 option for it to be saved to the database.

See this page for how to insert generic fields: https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/