Hi, I’m new here and need some help.
I need to make automatical system that will set categories on every “custom post” if checkbox with id “first-box” is checked. It will be like:
if $id(first-box) true{
set default categories with id(10,15,21,25)
}
Now i’m using on backend a script that works only on client side.
the code looks like:
$('#first-box').change(function(){
if (this.checked) {
$('input:checkbox[id^="in-cat-10"]').attr('checked',true);
$('input:checkbox[id^="in-cat-15"]').attr('checked',true);
$('input:checkbox[id^="in-cat-21"]').attr('checked',true);
$('input:checkbox[id^="in-cat-25"]').attr('checked',true);
}
})
And I think that code will be added on the function.php