WordPress uses the Advanced Custom Fields (ACF) plug-in.
Location rules.
タクPost Taxonomy 【 】Equivalent 【 カテCategory A 】
I set it to , but there was a change in the category after that.
When you delete Category A, the location rule is
タクPost Taxonomy 【 】Equivalent 【 未Unclassified <
Failed to rewrite to
When you delete a category, if the location rule contains the deleted category,
I want the rule itself to be deleted automatically, but
How can it be realized?
I would appreciate it if you could let me know.
wordpress
It's not a direct attack, but when you delete a category, you can use the hook delete_term_taxonomy
to find the slag of the category to be deleted from the ACF configuration data, and if it hits, you can overwrite the ACF configuration value.
ACF configuration is saved as a post in wp_posts
and rules are saved in post_content
.
If you overwrite this with wp_update_post()
, the rule disappears unless you press Update on the ACF Administration screen.
© 2024 OneMinuteCode. All rights reserved.