Skip to content

Instantly share code, notes, and snippets.

@gundamew
Created January 19, 2021 10:48

Revisions

  1. gundamew created this gist Jan 19, 2021.
    12 changes: 12 additions & 0 deletions example.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    <?php

    if ( ! wp_roles()->is_role( 'my_customer' ) ) {
    add_role(
    'my_customer',
    __( 'My customer' ),
    array_merge(
    wp_roles()->get_role( 'customer' )->capabilities,
    array( 'read_shop_order', 'read_private_shop_orders' )
    )
    );
    }