Skip to content

Commit

Permalink
fix: php warnings, phpcs warnings (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefferson Rabb authored Jun 30, 2020
1 parent 030024d commit 23b34a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/blocks/donate/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function newspack_blocks_render_block_donate( $attributes ) {

$campaign = $attributes['campaign'] ?? false;

$uid = rand(); // Unique identifier to prevent labels colliding with other instances of Donate block.
$uid = wp_rand( 10000, 99999 ); // Unique identifier to prevent labels colliding with other instances of Donate block.

$button_text = $attributes['buttonText'];

Expand Down Expand Up @@ -212,7 +212,6 @@ class='other-donate-label'
</form>
</div>
<?php

endif;

return apply_filters( 'newspack_blocks_donate_block_html', ob_get_clean() );
Expand All @@ -234,6 +233,9 @@ function newspack_blocks_register_donate() {
],
'suggestedAmounts' => [
'type' => 'array',
'items' => [
'type' => 'integer',
],
'default' => [ 0, 0, 0 ],
],
'suggestedAmountUntiered' => [
Expand All @@ -244,7 +246,7 @@ function newspack_blocks_register_donate() {
'default' => true,
],
'campaign' => [
'type' => 'string',
'type' => 'string',
],
'buttonText' => [
'type' => 'string',
Expand Down

0 comments on commit 23b34a1

Please sign in to comment.