Skip Navigation

[Resolved] How to add a function to a custom field?

This support ticket is created 6 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 1 reply, has 2 voices.

Last updated by Luo Yang 6 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1094917

Hi,
I heavily depend on shortlinks as my slugs are in arabic and percentage encoded, which makes them very long and visually not appealing on social media..

so i prefer to share the links linke this:

<em><u>hidden link</u></em>

these shortlinks come from Jetpack plugin, which enables the wordpress.com shortlinking to be used on hosted wordpress installations.
My problem is that i have to open each post in the backend, click on "Get shortlink" (located next to the post slug) then a popup opens with the shortlink.

I do this for thousands of posts.

My question to you is:
is there a way to auto populate a custom field with a function, so the shortlink appears in one of the Toolset custom fields in the backend?
then i can use the plugin "WP All Export Pro" to export the post title and this custom field,

I found a function in this web article, but the function is created to show the shortlink in the front end. i can tweak it to just echo the shortlink, but i don't know how to auto populate Toolset custom fields with a function, in the backend

hidden link

my aim is to have a single line custom field in the backend that shows this shortlink, so i can export it in bulk.

I appreciate your thoughts.

Thanks in advance.

#1095660

Hello,

There isn't such kind of feature within Toolset plugins, it needs custom codes, I have searched it in google, and found this thread:

https://wordpress.stackexchange.com/questions/265206/fetching-wp-me-shortlinks-for-posts-using-wp-rest-api?answertab=active#tab-top

It is resolved by registering a new field in the rest API, for your reference.