Creating custom taxonomies for topic categories and topic tags

Generally, we use taxonomies to group things that don't get changed often. Here, we are in need of two taxonomies for both topic categories and topic tags. Let's open the class-wpwaf-model-topic.php file and update the WPWAF_Model_Topic class constructor to implement the actions for taxonomy creation:

    class WPWAF_Model_Topic {       public $post_type;       public $topic_category_taxonomy;       public $topic_tag_taxonomy;       public $error_message;         public function __construct() {         $this->post_type = "wpwaf_topic";         $this->topic_category_taxonomy = "wpwaf_topic_category";         $this-> topic_tag_taxonomy = "wpwaf_topic_tag";         add_action('init', array($this,'create_topics_post_type'));  add_action('init', ...

Get Wordpress Web Application Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.