I’ve got the following error messages on the themecheck plugin in my WordPress theme.
REQUIRED: The theme uses the register_taxonomy() function, which is plugin-territory functionality.
REQUIRED: The theme uses the register_post_type() function, which is plugin-territory functionality.
WARNING: The theme uses the add_shortcode() function. Custom post-content shortcodes are plugin-territory functionality.
I declared the register_taxonomy()
and register_post_type()
function in after_setup_theme
hook.
My register_taxonomy()
function is:
register_taxonomy('project_cat', 'project', array(
'public' => true,
'hierarchical' => true,
'labels' => array(
'name' => 'Categories',
)
));
And one of my register_post_type()
function is:
register_post_type('service', array(
'public' => true,
'supports' => array('title', 'thumbnail', 'editor'),
'labels' => array(
'name' => esc_html__('Services', 'textdomain'),
'add_new_item' => esc_html__('Add Service', 'textdomain'),
'add_new' => esc_html__('Add Service', 'textdomain')
)
));
How can I fix those issues?