Skip Navigation

[Resolved] Edit Form with custom Post Status

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user has an edit form link to a Toolset Edit form with a custom post status and once the form sets the custom status on the post the Edit form link no longer appears on the post.

Solution:

We can actually workaround this issue by utilizing one of our internal hooks for Forms.

Add the following to your Toolset Custom Code section in Toolset->Settings->Custom Code. Ensure that you've activated the shortcode by clicking the "activate" link on the snippet.

add_filter( 'toolset_filter_edit_post_link_extra_statuses_allowed', 'ts_edit_link_statuses' );
function ts_edit_link_statuses( $stati ){
  
    $stati[] = 'special';
    return $stati;
}

Replace "special" with the slug of your custom post status and this should cause the Edit link to now appear.

This support ticket is created 3 years, 10 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Puntorosso 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1940301

Hi,
I have created an additional custom Post Status, apart from Publish, Draft ...
I use the shortcode

[toolset-edit-post-link content_template_slug='edit-objekt' target='self' style='color:#ffffff;']Objekt Edit[/toolset-edit-post-link]

on a CPT template, as link to edit that particular post, using a Cred form.

If the post have the custom Post Status assigned, the edit shortcode doesn't work.

#1941399

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

I did a quick test of this on my end with a custom post status and an edit form and I was able to see the edit link. Also clicking the link takes me to the form and submitting the form successfully changes the post status to my custom one.

Would you mind providing me with admin access to the site as well a link to a post where I can test out this issue ?

Thanks,
Shane

#1943017

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for the links to the issue. I was able to replicate the problem on my end, however I do believe this is there by design. I went ahead and escalated your thread so that our 2nd tier supporters can provide some more information on this one.

Once I get the information I will keep you up to date.

Thanks,
Shane

#1943019

Thanks Shane.
Let's hope the developers can give me a solution or, at least, a workaround.
Best

#1943763

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I have some good news, we do have an internal hook that can be used to include the edit link on your custom post status.
Add the following to your existing custom functions.

add_filter( 'toolset_filter_edit_post_link_extra_statuses_allowed', 'ts_edit_link_statuses' );
function ts_edit_link_statuses( $stati ){
 
	$stati[] = 'special';
	return $stati;
}

Replace "special" with the slug of your custom post status and this should cause the Edit link to now appear. Please let me know if this helps.
Thanks,
Shane

#1943817

That works! Thanks.