Skip Navigation

[Resolved] automatically connect relationship

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 0 reply, has 1 voice.

Last updated by Minesh 8 months, 3 weeks ago.

Assisted by: Minesh.

Author
Posts
#2786165

Users can create profile and upload artwork in the website.
But the uploaded artwork won't connect to the profile they've created.
Is there a way to automatically connect the relationship between "creator" and "artwork"?

I've found this code but it doesn't work.
https://toolset.com/forums/topic/automatically-create-relationship-based-on-user/

Thank you.

#2786244

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL from where on what course of the action you want to auto connect the posts and admin access details.

Once I review your setup I will be able to guide you in the right diretion.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2786546

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

As I understand, on the following page: hidden link

You have a form to add new Artwork post and you want that the parent (creator) to be auto connect as parent when user submit new Artwork post.

Also, parent creator will have only one post per registered user - is that correct?

If yes, What creator I should use to add new artwork? Can you please share access details for creator user.

I have set the next reply to private which means only you and I have access to it.

#2786571

Parent creator will have only one post per registered user - that's correct.

What I mean is to automatically link artwork that has previously filled out the creator form to the creator post, without specifying a particular creator user.

The process involves logged-in users being able to publish a creator post, and only after publishing the creator post can they upload artwork. Therefore, based on determining that the author of the artwork and the creator post are the same author, they should be automatically linked.

#2786622

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok I got it.

Can you please tell me using what frontend user I should login that has already created the creator post and on what page after login I should navigate to create the artwork post that you want to automatically link to the already created creator post.

I have set the next reply to private which means only you and I have access to it.

#2786631

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What I'm saying is I logged in as the following frontend user: Tamamako@protonmail.com

I would like to know have you already created the post for post type "creator" - if no, can you please create one test post for post type "creator" using the user Tamamako@protonmail.com and then I will add the dynamic code that should automatically link the artwork post to creator post you will create.

#2786632

Yes. This account has already created that post type.

#2786635

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - When I checked Creator post type listing page:
- hidden link

I do not see any post belongs to post author (user) "Tamamako@protonmail.com". Can you create one creator post belongs to user "Tamamako@protonmail.com".

#2786636

Sorry. Please recheck it. Thanks

#2786646

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've created the following view that will return the creator post ID where post author is loggedin user:
=> hidden link

Then to your artwork form:
=> hidden link

I've added the generic hidden field that will hold the creator post ID as given under:

[cred_generic_field type='hidden' field='@creator-s-artwork.parent']
{
"default":"[wpv-view name='get-creator-postid']"
}
[/cred_generic_field]

Can you please try to create new post for art work and check now if it automatically connected to parent creator post once you submit the artwork form and create new artwork post.