Skip Navigation

[Resolved] How to output the post ID inside a toolset post edit link

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

Problem:
Client is adding links to edit posts using the toolset-edit-post-link shortcode and wants to include the post ID of the post to be edited in the link text.

Solution:
Use the placeholder %%POST_ID%%.

See the screenshot in the answer below.

0% of people find this useful.

This support ticket is created 6 years, 5 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by julieP 6 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#913322

I have a View on a page (ID=25) that queries a post type and contains a post edit link shortcode for a content template which contains the edit post form. I'd like to use the returned post's ID (=34) as the text for the link and have tried it like this:-

[toolset-edit-post-link content_template_slug="content-template-slug"][wpv-post-id][/toolset-edit-post-link]

but this returns 25 (the ID of the page containing the View).

If I place [wpv-post-id] outside the post edit link shortcode like this:-

[toolset-edit-post-link content_template_slug="content-template-slug"][/toolset-edit-post-link][wpv-post-id]

this returns 34 (which is correct).

When I insert the [wp-post-id] shortcode, I'm selecting The current post being displayed either directly or in a View loop from the options.

How do I achieve the desired output please?

#913354

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-06-14 at 09.18.04.png

Hi Julie

It looks like the context for the post object changes inside the toolset-edit-post-link shortcode, which might not be possible to change.

Before thinking of any more complex workarounds, can you not just use the %%POST_ID%% placeholder?

#914560

Ha! I hadn't thought of that, thank you!!