Skip to main content

Timeline for Inserting Category programmatically

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
Oct 25, 2015 at 15:25 vote accept stlawrance
Oct 25, 2015 at 15:21 comment added chrisguitarguy It should be fine. The only way you'll know if it's too many or its an issue is if your server starts to underperform when it's under load. Until then, it's not a problem worth worrying about.
Oct 25, 2015 at 15:17 comment added stlawrance yes using your idea i did it . And successfully got inserted. But want to know is it good if we have large number of categories. I have even created a paste bin . Is it good to do like this? pastebin.com/rJ1QFgxF
Oct 25, 2015 at 14:45 comment added chrisguitarguy If you have more than one category you can track each ID or just track a boolean value to mark that you inserted things. add_option('wpse206511_inserted_terms', true) for instance. Your call.
Oct 25, 2015 at 14:40 comment added stlawrance yea and in second part of code should i manually insert category id in option ?
Oct 25, 2015 at 14:38 comment added chrisguitarguy Yep. You you just need to walk down the tree for each category. Start with the toplevel parent, insert next level parents, insert the child categories.
Oct 25, 2015 at 14:37 comment added stlawrance Yes thanks. But suppose i have more category like Science should i repeat the code from begining?
Oct 25, 2015 at 14:05 history answered chrisguitarguy CC BY-SA 3.0