How to restrict users and admin from creating new taxonomy terms?

This check:

    <?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?>

needs to be satisfied to display the “Add New Category” link.

You can set the capabilities for your schedule_day_taxonomy taxonomy, when you register it.

Example

Only users with the edit_schedule_day_taxonomy capability can edit the taxonomy:

add_action( 'init', 'schedule_day_tax_func' );
function schedule_day_tax_func() {
    register_taxonomy(
        'schedule_day_taxonomy',
        'post',
        array(
            'hierarchical' => true,
            'label' => 'Day',
            'query_var' => true,
            'capabilities' => array(
                'edit_terms' => 'edit_schedule_day_taxonomy',
            ),
        )
    );
}

Without this capability, users can’t edit this taxonomy. If you need to edit it, you can remove this from the code above or assign it to your admin user.

tech