Skip Navigation

[Résolu] Edit Post link not showing form

This support ticket is created Il y a 5 années et 3 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 8 réponses, a 2 voix.

Dernière mise à jour par frederikeM Il y a 5 années et 3 mois.

Assisté par: Luo Yang.

Auteur
Publications
#1318699

I am trying to: I have created a CPT called Therapists. It is used for a directory where each user can create one profile page. This works fine, but I am trying to insert an Edit link so that they can edit their own profile. I have followed the instructions here and gone through multiple times but can't work out what the issue is: https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/ and https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

I would also like the "edit post" link to only be shown to the author of the current post to avoid confusion for other users.

I have tried to switch to default 2019 theme but no change.

Link to a page where the issue can be seen: Can I email this to you? Would like to keep it hidden from the support forum. Or click on "find a therapist" in the menu, then click on one of the listings.

I expected to see: A form where users can edit their profile

Instead, I got: A page that shows the post content

#1318753

Hello,

I can log into your website and see the problem, it should be a compatibility problem, for example you can try these:
1) deactivate all other plugins, and switch to wordpress default theme 2019, and test again
2) If the problem is fixed, you can Activate other plugin one by one, try to locate the problem plugin/theme by these:
3) As you can see the Edit form link will pass URL parameter content-template-id=132 to target page, so you can also use PHP codes to display the specific content template content with PHP funciton render_view_template, for example:

render_view_template( $_GET['content-template-id'], $post );

More help:
https://toolset.com/documentation/programmer-reference/views-api/#render_view_template
Returns the content of a Content Template applied to a post.

#1318761

Thank you very much. I have followed your instructions and it seems that Yoast SEO was the culprit plugin. It is such a popular plugin though - any idea what could be causing the issue and how we can get it to be compatible? Otherwise I will look into your PHP code solution instead. Thanks.

#1318781

Since it is a compatibility issue, please provide a copy of your website in below private message box(you can put the duplicator package in your own google drive disk, and share the link), I need to duplicate the same problem and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1319847
#1319931

Thanks for the details, I can download the files, will update here if there is any found.

#1320005

Here are what I found:
1) I can duplicate the same problem in my localhost with your duplicator package, but can not duplicate the same problem in a fresh wordpress installation.

Can you provide detail steps to duplicate the same problem to duplicate the same problem in fresh wordpress installation + The latest version of Toolset plugins + Yoast SEO plugin?

2) Currently, it can be fixed be some custom codes, for example, you can add below codes into your theme file "functions.php":

add_filter( 'wpv_filter_force_template', 'prefix_fixed_content_for_edit_form', 99, 3 );
  
function prefix_fixed_content_for_edit_form( $template_selected, $id, $kind ) {
    if ( is_user_logged_in() && isset($_GET['content-template-id']) && is_numeric($_GET['content-template-id'])) { // if the user is logged in and is trying to view the post with URL parameter  "content-template-id"
		$template_selected = $_GET['content-template-id']; // assign a fixed Content Template "Edit Therapist" with ID 132 that contains a edit form
    }
    return $template_selected;
}

More help:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_force_template
Filters the ID of the Content Template that is going to be applied to a post.

#1320703

Thank you, that's strange, it must be something specific to my website then. I will just use the workaround you provided, it seems to work fine!

Thanks,
Frederike

#1320751

OK, please update here if you need more assistance for it, thanks

#1324025

My issue is resolved now. Thank you!