I am looking for a solution to a seemingly simple problem.
I have created a custom post type like is:
add_action( 'init', 'create_praise_report' );
function create_state() {
register_post_type( 'state',
array(
'labels' => array(
'name' => __( 'States' ),
'singular_name' => __( 'State' ),
),
'public' => true,
)
);
}
I have additional arguments in the array, but am keeping my code simple for discussion.
I want each post under the "State" custom post type to publish with a default category of "US States". While novicely searching the codex and trying different things I found this snippet:
register_taxonomy_for_object_type($taxonomy, $object_type);
Of which I changed to this:
register_taxonomy_for_object_type('us-states', 'state');
This did not not produce what I wanted. In fact I received an error after saving functions.php.
Thank you in advance for your help.