Been using this answer -->> (link) to create some custom fields in my categories
and it works great ! my only problem is that i have a frontend form that allows
creating new categories with an unrelated form and i would like to insert
values for my custom fields as well as each category pre-defined fields
i am currently adding the built in fields aka category name, slug & description
using wp_insert_term using this small check & insert script
if($_SERVER['REQUEST_METHOD'] == "POST") {
$clientName = $_POST["clientName"];
$term_id = $_POST["clientName"];
$clientKeywords = $_POST["clientKeywords"];
$clientSlug = $_POST["clientSlug"];
$parent = '';
$errorType = 'Category "'. $clientName .'" Added!';
wp_insert_term($clientName, 'category', array(
'description'=>$clientKeywords,
'slug'=>sanitize_title($clientSlug),
'parent'=>$parent
));
}
.
Again.. inserting the custom fields values from the backend using the
code i have found in the answer i have linked from at the beginning of
my question works very well but i have tried a lot of ways to make it
work from the front-end / integrate it with wp_insert_term and have
not succeeded so far.
Any help would be most appreciated