Skip Navigation

[Resolved] Query string on URL after CRED submit redirect

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

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)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 7 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#554913

Hi,

I'm tryng to remove query string on URL after redirect upond CRED submission.

I've correctly set redirect using cred_success_redirect hook but I still got ?cred_referrer_form_id=93 this string appended to my URL.

I'm sure that in the past redirection on hook didn't carry any query string. And I was pleased by this behaviour.

I see there is also another hook "cred_form_action_uri_querystring_array"

I've attempted to remove cred_referrer_form_id from querystring_array but I still get that string appended onto URL

Would you please help?
Thanks

Carlo

#554992

Dear Carlo,

This is expected result, the filter hook "cred_success_redirect " is triggered before CRED add URL parameter "cred_referrer_form_id", so filter hook "cred_success_redirect " can not remove URL parameter "cred_referrer_form_id", see the source coded of CRED plugin, file \cred-frontend-editor\application\models\form\post.php, line 124~131:


			if ( 'form' != $credaction && 'message' != $credaction ) {
				$url = apply_filters( 'cred_success_redirect_form_' . $form_slug, $url, $post_id, $thisform );
				$url = apply_filters( 'cred_success_redirect_' . $form_id, $url, $post_id, $thisform );
				$url = apply_filters( 'cred_success_redirect', $url, $post_id, $thisform );
			}

			if ( false !== $url ) {
				$url = add_query_arg( 'cred_referrer_form_id', $form_id, $url );

So there isn't such a feature to remove the URL parameter "cred_referrer_form_id", if you agree, we can take it as a feature request.