最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

json - Run hook in functions.php from page link

programmeradmin0浏览0评论

I'm writing a small function that takes a json file (~1000 objects) and uploads every json object to WordPress posts. I only need to have it run once to migrate data from another system.

I wrote the code in a function in functions.php and added a filter that ran it every time it loaded a page. It almost works but sometimes it runs multiple times.

Are there any way to trigger a hook from a link-click in front-end? That would need for me to get this to work.

发布评论

评论列表(0)

  1. 暂无评论