Skip Navigation

[Resolved] Edit link not working for custom post status

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 4 replies, has 2 voices.

Last updated by Minesh 9 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2680271

Ian
rejected-no-edit.jpeg

I have a view that allows a user to see all there posts with a custom post type of "vendor-photo". The view allows them to edit or delete their posts. It is working for posts with the status of Publish or Pending but not for the custom status of rejected. I need them to edit the post with the form so that they can make changes that will change the posts status back to pending for review by a manager.

#2680368

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

By default - views list post with post status publish. if you want to list the posts with custom post status 'rejected' then you should add a "Query Filter" to your view for the Post Status filter and add the required values you want to filter with like publish, private, pending, rejected.

More info:
- https://toolset.com/documentation/legacy-features/views-plugin/filtering-views-query-by-post-status/

#2680443

Ian

It is not that I need to filter by post status, as you can see from the image, posts that are; published, pending and published are showing up in my view. If you look at the bottom of the rejected post the edit link is not showing up like it does on the other posts. I need the user to be able to edit the post so it can be reviewed and eventually published.

#2680561

Minesh
Supporter

Languages: English (English )

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

Can you please share problem URL admin admin access details. Let me review whats going wrong with the edit link.

Please also share the frontend user access details using which you want to allow user to edit the post.

*** 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.

#2681858

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

I've added the following filter to "Custom Code" section offered by Toolset with code snippet namely "toolset-custom-code":
=> hidden link

function func_allowed_edit_link_post_statuses( $allowed_post_statuses, $form_id ) {
       
    $add_post_status = array('rejected');
    $allowed_post_statuses = array_merge($allowed_post_statuses,$add_post_status);
   
    return $allowed_post_statuses;
}
add_filter( 'toolset_filter_edit_post_link_publish_statuses_allowed', 'func_allowed_edit_link_post_statuses', 10, 2 );

Where:
- You can add/modify the post status value as required for $add_post_status variable.

More info:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/

#2682098

Ian

This solution works perfectly .