From 0584caed99c1cce51a2134d70e67841e718331ec Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Tue, 26 Nov 2019 13:54:15 -0500 Subject: [PATCH] Set deactivated pledges to readonly in the admin Otherwise saving will reactivate them --- plugins/wporg-5ftf/includes/pledge-meta.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/wporg-5ftf/includes/pledge-meta.php b/plugins/wporg-5ftf/includes/pledge-meta.php index 00a255d..10248da 100755 --- a/plugins/wporg-5ftf/includes/pledge-meta.php +++ b/plugins/wporg-5ftf/includes/pledge-meta.php @@ -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;