Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions includes/Admin/Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function add_campaign() {
$referer = wp_get_referer();

$name = isset( $_POST['name'] ) ? sanitize_text_field( wp_unslash( $_POST['name'] ) ) : '';
$cause = isset( $_POST['cause'] ) ? sanitize_textarea_field( wp_unslash( $_POST['cause'] ) ) : '';
$cause = isset( $_POST['cause'] ) ? wp_kses_post( wp_unslash( $_POST['cause'] ) ) : '';
$goal_amount = isset( $_POST['goal_amount'] ) ? floatval( wp_unslash( $_POST['goal_amount'] ) ) : floatval( '0' );
$end_date = isset( $_POST['end_date'] ) ? sanitize_text_field( wp_unslash( $_POST['end_date'] ) ) : '';
$status = isset( $_POST['status'] ) ? sanitize_key( wp_unslash( $_POST['status'] ) ) : 'pending';
Expand All @@ -47,7 +47,7 @@ public static function add_campaign() {
'ID' => $id,
'post_type' => 'wcdm_campaigns',
'post_title' => wp_strip_all_tags( $name ),
'post_content' => wp_kses_post( $cause ),
'post_content' => $cause,
'post_status' => $status,
'meta_input' => array(
'wcdm_goal_amount' => $goal_amount,
Expand Down Expand Up @@ -83,7 +83,7 @@ public static function edit_campaign() {
$referer = wp_get_referer();

$name = isset( $_POST['name'] ) ? sanitize_text_field( wp_unslash( $_POST['name'] ) ) : '';
$cause = isset( $_POST['cause'] ) ? sanitize_textarea_field( wp_unslash( $_POST['cause'] ) ) : '';
$cause = isset( $_POST['cause'] ) ? wp_kses_post( wp_unslash( $_POST['cause'] ) ) : '';
$goal_amount = isset( $_POST['goal_amount'] ) ? floatval( wp_unslash( $_POST['goal_amount'] ) ) : floatval( '0' );
$end_date = isset( $_POST['end_date'] ) ? sanitize_text_field( wp_unslash( $_POST['end_date'] ) ) : '';
$status = isset( $_POST['status'] ) ? sanitize_key( wp_unslash( $_POST['status'] ) ) : 'pending';
Expand Down
16 changes: 15 additions & 1 deletion includes/Admin/views/campaigns/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,21 @@
<label for="cause"><?php esc_html_e( 'Cause', 'wc-donation-manager' ); ?></label>
</th>
<td>
<textarea name="cause" id="cause" class="regular-text" rows="6" placeholder="<?php esc_html_e( 'Enter the cause of the campaign...', 'wc-donation-manager' ); ?>"></textarea>
<?php

wp_editor(
'',
'wcdm_donation_cause_editor',
array(
'textarea_name' => 'cause',
'media_buttons' => true,
'textarea_rows' => 12,
'teeny' => false,
'quicktags' => true,
)
);

?>
<p class="description">
<?php esc_html_e( 'Enter the cause of the campaign.', 'wc-donation-manager' ); ?>
</p>
Expand Down
16 changes: 15 additions & 1 deletion includes/Admin/views/campaigns/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,21 @@
<?php esc_html_e( 'Cause', 'wc-donation-manager' ); ?>
</label>
<div class="field-group">
<textarea name="cause" id="cause" class="regular-text" rows="6" placeholder="<?php esc_html_e( 'Enter the cause of the campaign...', 'wc-donation-manager' ); ?>"><?php echo wp_kses_post( $campaign->post_content ); ?></textarea>
<?php

wp_editor(
wp_kses_post( $campaign->post_content ),
'wcdm_donation_cause_editor',
array(
'textarea_name' => 'cause',
'media_buttons' => true,
'textarea_rows' => 12,
'teeny' => false,
'quicktags' => true,
)
);

?>
<p class="description">
<?php esc_html_e( 'Edit or update the cause of the campaign.', 'wc-donation-manager' ); ?>
</p>
Expand Down
Loading