Skip Navigation

[Resolved] Sync publish status between relationships

This support ticket is created 4 years, 2 months 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Author
Posts
#1517275

Tell us what you are trying to do?
I have 2 custom post types Public listing and Restricted Listing.
They contain similar information but no the same. I would like make their publish status in sync
So, if A restricted listing goes draft, a corresponding public listing goes draft as well.

Is there any documentation that you are following?
I looked documenation and support but I cannot find answers

Is there a similar example that we can see?
Our site is something like craigslist. People can view a listing, but they need sign an agreement to view more information of the listing(which is separated posting type connected with relationship)

What is the link to your site?
hidden link

Question #2

Is there anyway to charge people to extend post expiration time which is originally creted via WP toolset form plugin create form with Woocommerce?

#1518097

Hello,

Q1) make their publish status in sync
There isn't such kind of built-in feature within Toolset, you might consider custom codes, for example, when user save a "restricted listing" post, use action hook save_post to trigger a PHP function:
https://developer.wordpress.org/reference/hooks/save_post/
Get the related "public listing" post ID(IDs):
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts
Update the "public listing" post status to what you want:
https://developer.wordpress.org/reference/functions/wp_update_post/

Q2) Is there anyway to charge people to extend post expiration time which is originally creted via WP toolset form plugin create form with Woocommerce?
No, there isn't such kind of built-in feature yet, you can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our developers will evaluate it.

Currently, you might consider custom codes, for example:
1) Create a post form for editing post, follow our document to charge people when they submit this form:
https://toolset.com/documentation/user-guides/front-end-forms/using-cred-commerce-to-add-payments-to-forms/

2) After people complete the Woocommerce order, use action hook to trigger a custom PHP function
hidden link
Update the custom field value "_cred_post_expiration_time" to what you want, the field "_cred_post_expiration_time" is a hidden custom field, stores value in timestamp format.

According to our support policy, we prefer one ticket one question, if you need more assistance for it, please create a new ticket for the 2nd question. thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.