Skip Navigation

[Resolved] form hooks not working with relationship form

This support ticket is created 6 years, 1 month 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
- 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 9 replies, has 4 voices.

Last updated by Minesh 3 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1148102
x.jpg

Hi,

I am trying to hock into save action of relationships form

I tried the following with no luck

//Add multiple items based on qty
add_action('cred_save_data_6275', 'create_package_items', 10, 2);
function create_package_items($post_id, $formdata){
	var_dump($formdata);
	die();
}

//test
add_filter('cred_success_redirect', 'dddd', 10, 3);
function dddd($url, $post_id, $thisform) {
	if ($form_data['id']==6275){
		var_dump($formdata);
		die();
	}
}
#1148985

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - for post relationship form there is no such API available for now but we already filed this feature request to our internal system and our Devs are aware about it and as far as I can see the API hooks for post relationship forms is set to relsease with near feature release of Toolset Forms version 2.2.

I suggest you to keep eye on our blog for future updates.
=> https://toolset.com/blog/

#1149149

Okay thanks.

#1149152

Minesh
Supporter

Languages: English (English )

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

thank you - feel free to resolve the ticket 🙂

#1149163

My issue is resolved now. Thank you!

#1164158

why resolved?
still where can we find API hooks for post relationship forms????

#1988855

This is a little catastrophe - we can't apply any action at all on a relationship form submit event?!
How are we supposed to create forms in M2M that actually follow even the tiniest custom logic?

🙁

#1988959

Minesh
Supporter

Languages: English (English )

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

Hi Beda,

As you may already know that this is known and we do have internal ticket to add this feature but there no ETA on it yet. I do not see any progress with internal ticket and you can not expect it soon as Devs have other predefined priorities.

#1989189

Hi Minesh

That’s right, it’s known
And also stated to be slated for some CRED version 2.2. - that was back in 2018, almost 3 years ago, while not implemented the ticket is marked as fixed - which is really a bit “smack in the face” 🙂

It’s not really that much work giving us a filter which passes a form ID and perhaps the $_POST data of the form fields. No one asks for advanced api or GUI in this specific case.

That’s all a developer needs to work around all the (miserable, if we are honest) restrictions that the M2M forms have

I know you can’t change it, but I also know it’s not implemented (amongst other reasons, of course) because “no users request it”. This might be because all who need this feature don’t have time to request, and wait 3+ years to get it done. Clients want projects done in months... not years.
They move on, and don’t even think about bugging here in forums or else.

It’s really a showstopper, you know. Because you can’t simply workaround it in other forms, or save post actions, due to the relatively unique structure of M2Ms
Of course, with code we can solve many things, but it gets dirty, hacky and makes it impossible for end users (clients) to later edit things on their own
So a filter would be really some minimal thing I would expect to be added, also because - but not last - it’s a WordPress plugin, and one of the best things of WordPress are filters!

It’s what makes WordPress what it is, after all implementing a relationship can also be done with plugins like meta box, which offers all these missing features out of the box, or plain simple custom code.
If we need to create dirty hacks, we can as well invest a bit more time and just create things from scratch.
This is bad for toolset, not the developer or contractor - we gain money with those things. Toolset loses.

This project I’m working on is based on toolset and a migration isn’t that simple, unfortunately - but given within short amount of hours several impossibilities came up within the relationship structure, we have to consider it.

Well, I’ve also submitted a formal feature request for this to be added - let’s hope it gets some ears

Thanks for your interaction on this old ticket.

#1990139

Minesh
Supporter

Languages: English (English )

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

Thanks Beda for filing the new feature request, hopefully, it will get reviewed by concern person and hopefully the feature added in near future.