Inserting Taxonomy Terms During a Plugin Activation?
Here is the fixed version of your code. class vsetup { function __construct() { register_activation_hook(__FILE__,array($this,’activate’)); add_action( ‘init’, array( $this, ‘create_taxonomies’ ) ); } function activate() { $this->create_taxonomies(); wp_insert_term(‘Action’,’genre’); wp_insert_term(‘Adventure’,’genre’); } function create_taxonomies() { $genre_args = array( ‘hierarchical’ => true, ‘labels’ => array( ‘name’=> _x(‘Genres’, ‘taxonomy general name’ ), ‘singular_name’ => _x(‘Genre’, ‘taxonomy singular name’), ‘search_items’ … Read more