Answer the question
In order to leave comments, you need to log in
How to import subcategories via csv?
Good afternoon. I'm trying to finish the import plugin. Faced such a problem. The plugin creates a $categories variable. It is also passed to taxonomy.php and there the foreach method turns it into an ordinary category. I changed the plugin a bit. Using the wp_create_categories($category, $id) function, I tried to transfer the sub-category. It didn't migrate, and reported an error in post.php.
Please help solve the problem. I'm not looking for ready-made answers, what should I read in order to better understand the work of wordpress in this particular area? Any help will be glad)
Answer the question
In order to leave comments, you need to log in
Hello!
Your end goal is not entirely clear. Are you writing a plugin and run into a problem, or do you need to import a csv file into your site?
If the second option, then use the Wp All Import plugin, it has functionality for importing nested categories. The same can be done using the WP REST API if you need to parse some data directly into the VI.
what should I read to better understand how wordpress works in this particular area?
I changed the plugin a bit.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question