The problem is because your rewrite
argument is part of the labels
, but rewrite
is actually same level as the labels
, so just move the rewrite
to after the labels
and the problem will be gone. 🙂
register_post_type('artwork', array(
'public' => true,
'menu_icon' => 'dashicons-art',
'labels' => array(
'name' => 'Artwork',
'add_new_item' => 'Add New Artwork',
'edit_item' => 'Edit Artwork',
'all_items' => 'All Artwork',
'singular_name' => 'Artwork',
),
// Move the "rewrite" to below:
'rewrite' => array(
'slug' => 'art',
'with_front' => false,
'pages' => true, // this also belongs in "rewrite" and not "labels"
),
));