Skip to content

Commit

Permalink
👌 Complete #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel-James committed Jan 29, 2022
1 parent 62bf337 commit 569ef31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can customize the notice behaviour using options. All these options are opti
| `classes` | array | Additional class names for notice. |
| `domain` | string | Text domain string for internationalization. |
| `message` | string | Notice main message (to override default message). |
| `action_labels` | array | To use different labels for action links. Available items are: `review`, `later`, `dismiss`. |
| `action_labels` | array | To use different labels for action links. Available items are: `review`, `later`, `dismiss`. Remember to escape. |
| `prefix` | string | To override plugin option and other key prefixes. By default it's plugin slug with dashes replaces with underscores. |

### Credits
Expand Down
18 changes: 9 additions & 9 deletions src/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,21 @@ class="<?php echo esc_attr( $this->get_classes() ); ?>">
<?php if ( ! empty( $this->action_labels['review'] ) ) : ?>
<p>
<a href="https://wordpress.org/support/plugin/<?php echo esc_html( $this->slug ); ?>/reviews/#new-post" target="_blank">
<?php esc_html_e( 'Ok, you deserve it', $this->domain ); ?>
<?php echo $this->action_labels['review']; ?>
</a>
</p>
<?php endif; ?>
<?php if ( ! empty( $this->action_labels['later'] ) ) : ?>
<p>
<a href="<?php echo esc_url( add_query_arg( $this->key( 'action' ), 'later' ) ); ?>">
<?php esc_html_e( 'Nope, maybe later', $this->domain ); ?>
<?php echo $this->action_labels['later']; ?>
</a>
</p>
<?php endif; ?>
<?php if ( ! empty( $this->action_labels['dismiss'] ) ) : ?>
<p>
<a href="<?php echo esc_url( add_query_arg( $this->key( 'action' ), 'dismiss' ) ); ?>">
<?php esc_html_e( 'I already did', $this->domain ); ?>
<?php echo $this->action_labels['dismiss']; ?>
</a>
</p>
<?php endif; ?>
Expand Down Expand Up @@ -500,12 +500,12 @@ private function setup( $slug, $name, array $options ) {
$options = wp_parse_args(
$options,
array(
'days' => 7,
'screens' => array(),
'cap' => 'manage_options',
'classes' => array(),
'domain' => 'duckdev',
'actions' => array(),
'days' => 7,
'screens' => array(),
'cap' => 'manage_options',
'classes' => array(),
'domain' => 'duckdev',
'action_labels' => array(),
)
);

Expand Down

0 comments on commit 569ef31

Please sign in to comment.