I want to set the value inserted in the "CustomFieldSuite" of the WordPress plug-in to the permalink.

Asked 2 years ago, Updated 2 years ago, 78 views

We are building a site using the WordPress plug-in CustomFieldSuite

Custom Posts use CPTUI as "merchandise"
I applied CFS to it and created a field called "num", and I want to slag the value I set for that num field.

Example) Value for https://xxx.com/merchandise/num

I've looked into many things
br/> I am troubled that only the example of the similar plug-in AdvanceCustomField is listed.

I thought you might use an action hook, so I wrote
in function.php. https://mgibbs189.github.io/custom-field-suite/api/save.html
I tried to save the value as shown here, but it didn't work out well.

If anyone knows, I would like to ask for your help.
Thank you for your cooperation.

php html css wordpress

2022-09-30 17:29

1 Answers

This is probably helpful.

How to Replace WordPress Post Slags with Custom Field Values

I think the following mechanisms are introduced.

  • With custom field values
  • When saving articles, rewrite the slag and save it

So, wouldn't it be better to use slag without using custom fields?
There may be a strong reason why you want to use custom fields.

Also, I think the perm link will not take effect unless you set it in the postname, so please check it together.


2022-09-30 17:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.