Set deactivated pledges to readonly in the admin

Otherwise saving will reactivate them
This commit is contained in:
Kelly Dwan 2019-11-26 13:54:15 -05:00
parent 012a6b76a0
commit 0584caed99
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D

View file

@ -208,7 +208,10 @@ function add_meta_boxes() {
* @param array $box
*/
function render_meta_boxes( $pledge, $box ) {
$readonly = ! current_user_can( 'edit_page', $pledge->ID );
$readonly = (
! current_user_can( 'edit_page', $pledge->ID ) ||
Pledge\DEACTIVE_STATUS === $pledge->post_status
);
$is_manage = true;
$pledge_id = $pledge->ID;