-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package creating #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run composer require --dev itinerisltd/itineris-wp-coding-standards:dev-2023-02-01
composer.lockDev Package changes
Settings · Docs · Powered by Private Packagist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every echo
needs escape
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Can you add screenshot of frontend and backend to README?
public function get_field_input($form, $value = '', $entry = null): string | ||
{ | ||
$id = (int) $this->id; | ||
$giftaidImage = ITINERIS_GF_GIFT_AID_FIELD_URI . '/assets/giftaid.svg'; | ||
|
||
ob_start(); | ||
?> | ||
<div class="gift-box-wrapper bg-gray-50 rounded-br-4 p-7.5"> | ||
<div class="gift-aid-logo mb-2"> | ||
<img src="<?php echo esc_url($giftaidImage); ?>" alt="GiftAid logo"> | ||
</div> | ||
<div class="description text-primary font-medium text-xl mb-2"> | ||
<?php //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> | ||
<?php echo wpautop(wp_kses_post($this->get_calculated_gift())); ?> | ||
</div> | ||
<div class="gift-box-form-wrapper my-6 pb-6 border-b border-b-gray-200"> | ||
<div class="ginput_container ginput_container_checkbox mb-6"> | ||
<div class="gfield_checkbox" id="input_<?php echo esc_attr($id); ?>"> | ||
<div class="gchoice gchoice_<?php echo esc_attr($id); ?>"> | ||
<input | ||
class="gfield-choice-input" | ||
id="gift-check-<?php echo esc_attr($id); ?>" | ||
name="gift-check-<?php echo esc_attr($id); ?>" | ||
type="checkbox" | ||
value="1" | ||
> | ||
<label for="gift-check-<?php echo esc_attr($id); ?>"> | ||
<?php echo esc_html($this->label); ?> | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="details-description"><?php echo esc_html($this->description); ?></div> | ||
</div> | ||
<?php | ||
return ob_get_clean(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exists a way to not mix PHP and HTML ? I suggest to export this is another file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that will be fine for next version/release. Now should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't do that from the start then we will do never. Trust me, I know.
src/GiftAidField.php
Outdated
|
||
public function get_calculated_gift(): string | ||
{ | ||
$calculationText = 'With Gift Aid, your donation of {{ donation }} would be worth {{ calculated_gift_aid }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$calculationText = 'With Gift Aid, your donation of {{ donation }} would be worth {{ calculated_gift_aid }} | |
$calculationText = 'With Gift Aid, your donation of {{ donation }} would be worth {{ calculated_gift_aid }} |
Client should be able to edit this text from admin panel
$totalAmt = $donation + $amount; | ||
$displayNum = number_format((float) $totalAmt, 2, '.', ''); | ||
$searchReplace = [ | ||
'{{ donation }}' => "<span class=\"gform_donation_total\">£{$donation}</span>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if its okay to hardcode the currency £
The composer.lock diff comment has been updated to reflect new changes in this PR. |
The composer.lock diff comment has been updated to reflect new changes in this PR. |
No description provided.