Monthly Archives: September 2015


Programatically Adding Categories in ExpressionEngine

Well that’s one confusing title. Ok so how to add categories in EE when building custom add-ons. We’ve used this a number of times when creating import scripts. private function _create_categories($categories, $group_id) { $site_id = $this->EE->config->item(‘site_id’); foreach ($categories as $cat_url_title => $cat_name) { $newCategory = array( ‘group_id’ => $group_id, ‘cat_name’ => $cat_name, ‘cat_url_title’ => $cat_url_title, […]