Skip to content

Commit

Permalink
fix checkbox status not updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
renintw committed May 28, 2024
1 parent 0947a68 commit b5273d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@
<table>
<tbody>
<tr>
<th><input id="wcor_transparency_report" name="wcor_transparency_report" type="checkbox" value="wcor_transparency_report" <?php checked( $post->wcor_transparency_report ); ?>></th>
<td><label for="wcor_transparency_report">For transparency report: triggered when <strong>NOT</strong> 'Running money through WPCS PBC'</label></td>
<th><input id="wcor_transparency_report" name="wcor_transparency_report" type="checkbox" value="wcor_transparency_report" <?php checked( $post->wcor_transparency_report, 'wcor_transparency_report' ); ?>></th>
<td><label for="wcor_transparency_report">For transparency report - triggered when <strong>NOT</strong> 'Running money through WPCS PBC'</label></td>
</tr>

<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ protected function save_post_meta( $post, $new_meta ) {
}
}

delete_post_meta( $post->ID, 'wcor_transparency_report' );
if ( isset( $new_meta['wcor_transparency_report'] ) ) {
update_post_meta( $post->ID, 'wcor_transparency_report', $new_meta['wcor_transparency_report'] );
}
Expand Down

0 comments on commit b5273d8

Please sign in to comment.