Skip to content

Commit 569ef31

Browse files
committedJan 29, 2022
👌 Complete #2
1 parent 62bf337 commit 569ef31

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ You can customize the notice behaviour using options. All these options are opti
4949
| `classes` | array | Additional class names for notice. |
5050
| `domain` | string | Text domain string for internationalization. |
5151
| `message` | string | Notice main message (to override default message). |
52-
| `action_labels` | array | To use different labels for action links. Available items are: `review`, `later`, `dismiss`. |
52+
| `action_labels` | array | To use different labels for action links. Available items are: `review`, `later`, `dismiss`. Remember to escape. |
5353
| `prefix` | string | To override plugin option and other key prefixes. By default it's plugin slug with dashes replaces with underscores. |
5454

5555
### Credits

‎src/Notice.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -228,21 +228,21 @@ class="<?php echo esc_attr( $this->get_classes() ); ?>">
228228
<?php if ( ! empty( $this->action_labels['review'] ) ) : ?>
229229
<p>
230230
<a href="https://wordpress.org/support/plugin/<?php echo esc_html( $this->slug ); ?>/reviews/#new-post" target="_blank">
231-
<?php esc_html_e( 'Ok, you deserve it', $this->domain ); ?>
231+
<?php echo $this->action_labels['review']; ?>
232232
</a>
233233
</p>
234234
<?php endif; ?>
235235
<?php if ( ! empty( $this->action_labels['later'] ) ) : ?>
236236
<p>
237237
<a href="<?php echo esc_url( add_query_arg( $this->key( 'action' ), 'later' ) ); ?>">
238-
<?php esc_html_e( 'Nope, maybe later', $this->domain ); ?>
238+
<?php echo $this->action_labels['later']; ?>
239239
</a>
240240
</p>
241241
<?php endif; ?>
242242
<?php if ( ! empty( $this->action_labels['dismiss'] ) ) : ?>
243243
<p>
244244
<a href="<?php echo esc_url( add_query_arg( $this->key( 'action' ), 'dismiss' ) ); ?>">
245-
<?php esc_html_e( 'I already did', $this->domain ); ?>
245+
<?php echo $this->action_labels['dismiss']; ?>
246246
</a>
247247
</p>
248248
<?php endif; ?>
@@ -500,12 +500,12 @@ private function setup( $slug, $name, array $options ) {
500500
$options = wp_parse_args(
501501
$options,
502502
array(
503-
'days' => 7,
504-
'screens' => array(),
505-
'cap' => 'manage_options',
506-
'classes' => array(),
507-
'domain' => 'duckdev',
508-
'actions' => array(),
503+
'days' => 7,
504+
'screens' => array(),
505+
'cap' => 'manage_options',
506+
'classes' => array(),
507+
'domain' => 'duckdev',
508+
'action_labels' => array(),
509509
)
510510
);
511511

0 commit comments

Comments
 (0)