Skip to content

Commit

Permalink
Merge f6f80bf into 51a9dfe
Browse files Browse the repository at this point in the history
  • Loading branch information
kidunot89 committed May 2, 2019
2 parents 51a9dfe + f6f80bf commit a176caf
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/model/class-crud-cpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public function __construct( $allowed_restricted_fields, $post_type, $post_id )
$GLOBALS['post'] = $post;
setup_postdata( $post );

$restricted_cap = $this->get_restricted_cap();
$restricted_cap = apply_filters(
$this->post_type_object->name . '_restricted_cap',
$this->get_restricted_cap()
);

parent::__construct( $restricted_cap, $allowed_restricted_fields, $author_id );
}
Expand Down
4 changes: 3 additions & 1 deletion src/model/class-customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public function __construct( $id ) {
'displayName',
];

parent::__construct( 'list_users', $allowed_restricted_fields, $id );
$restricted_cap = apply_filters( 'customer_restricted_cap', 'list_users' );

parent::__construct( $restricted_cap, $allowed_restricted_fields, $id );
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/model/class-order-item.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public function __construct( $item ) {
'orderItemId',
);

parent::__construct( '', $allowed_restricted_fields, null );
$restricted_cap = apply_filters( 'order_item_restricted_cap', '' );

parent::__construct( $restricted_cap, $allowed_restricted_fields, null );
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/model/class-shipping-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function __construct( $method ) {
'rateId',
);

parent::__construct( '', $allowed_restricted_fields, null );
$restricted_cap = apply_filters( 'shipping_method_restricted_cap', '' );

parent::__construct( $restricted_cap, $allowed_restricted_fields, null );
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/model/class-tax-rate.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function __construct( $rate ) {
'rateId',
);

parent::__construct( '', $allowed_restricted_fields, null );
$restricted_cap = apply_filters( 'tax_rate_restricted_cap', '' );

parent::__construct( $restricted_cap, $allowed_restricted_fields, null );
}

/**
Expand Down

0 comments on commit a176caf

Please sign in to comment.