Skip Navigation

[Resolved] Is there a way to globally append edit post link using WordPress hooks?

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

Last updated by George Valdez 7 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#564897

I want to know if there is a way to globally append an edit link on blog post type and product post type without having to create a whole content layout? Like for instance, I create a CRED form to edit post and another CRED form to edit product. Next use a edit post shortcode that will appear on the bottom of the post or product like the one I see for WordPress Admins/Authors but instead of it linking to backend, it will link to the CRED forms I created. I want it to appear only if the user is the author of that post. I thought of using hooks to append the shortcode on a global scale without having to do it manually for each post or having to create a content layout for it. Is there an easier way to implement this snippet? If not, maybe this will definitely be a nice feature to have for those that wish to just append something to the themes post content layout. I remember seeing a similar method in the User Submitted Posts where the admin could set where they wanted the photos to appear (before/after content)

#564950

Dear George,

You can try with WordPress built-in hook "the_content":
https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content
The "the_content" filter is used to filter the content of the post after it is retrieved from the database and before it is printed to the screen
But it needs custom PHP codes, for your reference.

#566039

Thank you, I will check that out.