plugin development – add_action pre_term_description vs pre_category_description

I'm trying to define a default tag and a (different) description of the default category in case no data is provided during the creation.

I found the action "pre_category_description", but not equivalent for the tags. The only thing I could find is "pre_term_description", but this one behaves in a strange way.

I've added the following code to my plugin:

add_action (& # 39; pre_term_description & # 39; default_term & # 39;);
default_term function ($ description) {
if ($ description == & # 39;) {
$ description_new = "description of the default term";
} other {
$ description_new = $ description;
}
error_log ("definition of the definition term");
return $ description_new;
}

add_action (& # 39; pre_category_description & # 39; & # 39; default_category & # 39;);
function default_category ($ description) {
if ($ description == & # 39;) {// we only replace if there is a parameter and no input
$ description_new = "description of the default category";
} other {
$ description_new = $ description;
}
error_log ("definition of the description category");
return $ description_new;
}

However, it appears that the pre_term description is running for the tags AND categories, and the term description replaces category 1, although it was executed last.

If I add a new label, I get this log entry:

[06-Dec-2018 07:44:54 UTC]    setting the term description

and the resulting description is "description of the default term"

if I add a new category, I get it here:

[06-Dec-2018 07:44:54 UTC]    setting the term description
[06-Dec-2018 07:44:54 UTC] parameter category description

and the resulting description is ALSO "description of the default term"

How can I tell if the changed item is a category or tag for it to work properly?