0

I am looking for a function that will fire a php file when a category is updated. I don't really want to use a plugin, just want a function to go in functions.php. Can anyone point me in the right direction?

Thanks in advance.

Seems there was a function called "edited_category" but this seems to have been renamed to edited_{$taxonomy} .But I can find no documentation on how to use this. Anyone got any Ideas?

4

1 回答 1

0

您可以使用edit_category 钩子

在更新/编辑类别时运行,包括添加/删除帖子或博客链接或更新其类别时(这会导致类别计数更新)。动作函数参数:类别 ID。

您可以在functions.php文件中添加挂钩,如下所示

add_action ( 'edited_category', 'update_category_function');
function update_category_function( $category_id )
{
    // ...
}
于 2013-06-05T20:09:50.593 回答