Skip to content

Commit 867a99f

Browse files
authored
Merge branch 'develop' into filip/v18/set-date-format
2 parents 3a0349d + bf801f8 commit 867a99f

23 files changed

Lines changed: 47 additions & 26 deletions

assets/css/page-widgets/todo.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
font-size: var(--prpl-font-size-small);
211211

212212
&:hover {
213+
text-decoration: underline;
213214

214215
svg path {
215216
fill: var(--prpl-color-accent-red);
@@ -342,7 +343,12 @@
342343
padding: 0;
343344
margin: 0;
344345
cursor: pointer;
345-
text-decoration: underline;
346+
347+
&:hover,
348+
&:focus,
349+
&:active {
350+
text-decoration: underline;
351+
}
346352
}
347353
}
348354
}

assets/css/suggested-task.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,17 @@
144144
}
145145
}
146146

147+
/* Close and toggle radio group buttons should not have a text decoration. */
148+
.prpl-tooltip-close,
149+
.prpl-toggle-radio-group {
150+
151+
&:hover,
152+
&:focus,
153+
&:active {
154+
text-decoration: none;
155+
}
156+
}
157+
147158
}
148159
}
149160

assets/js/suggested-task.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ prplSuggestedTask = {
545545
if ( event.key === 'Enter' ) {
546546
event.preventDefault();
547547
event.stopPropagation();
548+
event.target.blur();
548549
return false;
549550
}
550551
},

classes/suggested-tasks/providers/class-content-create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function should_add_task() {
130130
public function add_task_actions( $data = [], $actions = [] ) {
131131
$actions[] = [
132132
'priority' => 10,
133-
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( 'post-new.php' ) . '" target="_blank">' . \esc_html__( 'Create new post', 'progress-planner' ) . '</a>',
133+
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( 'post-new.php' ) . '" target="_self">' . \esc_html__( 'Create new post', 'progress-planner' ) . '</a>',
134134
];
135135

136136
return $actions;

classes/suggested-tasks/providers/class-content-review.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ protected function get_expiration_period( $dismissal_data ) {
573573
public function add_task_actions( $data = [], $actions = [] ) {
574574
$actions[] = [
575575
'priority' => 10,
576-
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( 'post.php?action=edit&post=' . $data['id'] ) . '" target="_blank">' . \esc_html__( 'Review', 'progress-planner' ) . '</a>',
576+
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( 'post.php?action=edit&post=' . $data['id'] ) . '" target="_self">' . \esc_html__( 'Review', 'progress-planner' ) . '</a>',
577577
];
578578

579579
return $actions;

classes/suggested-tasks/providers/class-core-update.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function add_core_update_link( $update_actions ) {
9797
if ( $this->get_task_id() === $task->task_id ) {
9898
$update_actions['prpl_core_update'] =
9999
'<img src="' . \esc_attr( \constant( 'PROGRESS_PLANNER_URL' ) . '/assets/images/icon_progress_planner.svg' ) . '" style="width:1rem;padding-left:0.25rem;padding-right:0.25rem;vertical-align:middle;" alt="Progress Planner" />' .
100-
'<a href="' . \esc_url( \admin_url( 'admin.php?page=progress-planner' ) ) . '" target="_parent">' . \esc_html__( 'Click here to celebrate your completed task!', 'progress-planner' ) . '</a>';
100+
'<a href="' . \esc_url( \admin_url( 'admin.php?page=progress-planner' ) ) . '" target="_self">' . \esc_html__( 'Click here to celebrate your completed task!', 'progress-planner' ) . '</a>';
101101
break;
102102
}
103103
}
@@ -143,7 +143,7 @@ public function is_task_completed( $task_id = '' ) {
143143
public function add_task_actions( $data = [], $actions = [] ) {
144144
$actions[] = [
145145
'priority' => 10,
146-
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( 'update-core.php' ) . '" target="_blank">' . \esc_html__( 'Go to the Updates page', 'progress-planner' ) . '</a>',
146+
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( 'update-core.php' ) . '" target="_self">' . \esc_html__( 'Go to the Updates page', 'progress-planner' ) . '</a>',
147147
];
148148

149149
return $actions;

classes/suggested-tasks/providers/class-email-sending.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function init() {
125125
$this->email_subject = \esc_html__( 'Your Progress Planner test message!', 'progress-planner' );
126126
$this->email_content = \sprintf(
127127
// translators: %1$s the admin URL.
128-
\__( 'You just used Progress Planner to verify if sending email works on your website. <br><br> The good news; it does! <a href="%1$s" target="_blank">Click here to mark Ravi\'s Recommendation as completed</a>.', 'progress-planner' ),
128+
\__( 'You just used Progress Planner to verify if sending email works on your website. <br><br> The good news; it does! <a href="%1$s" target="_self">Click here to mark Ravi\'s Recommendation as completed</a>.', 'progress-planner' ),
129129
\admin_url( 'admin.php?page=progress-planner&prpl_complete_task=' . $this->get_task_id() )
130130
);
131131
}

classes/suggested-tasks/providers/class-hello-world.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected function get_description() {
108108
$content .= \sprintf(
109109
/* translators: %s: Link to the post. */
110110
\esc_html__( 'On install, WordPress creates a "Hello World!" post. You can find yours at %s.', 'progress-planner' ),
111-
'<a href="' . \esc_attr( $hello_world_post_url ) . '" target="_blank">' . \esc_html( $hello_world_post_url ) . '</a>',
111+
'<a href="' . \esc_attr( $hello_world_post_url ) . '" target="_self">' . \esc_html( $hello_world_post_url ) . '</a>',
112112
);
113113
$content .= '</p><p>';
114114
$content .= \esc_html__( 'This post does not add value to your website and solely exists to show what a post can look like. Therefore, "Hello World!" is not needed and should be deleted.', 'progress-planner' );

classes/suggested-tasks/providers/class-tasks.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,14 @@ public function get_task_actions( $data = [] ) {
666666
];
667667
}
668668

669-
$actions = $this->add_task_actions( $data, $actions );
670-
foreach ( $actions as $key => $action ) {
671-
$actions[ $key ]['priority'] = $action['priority'] ?? 1000;
672-
if ( ! isset( $action['html'] ) || '' === $action['html'] ) {
673-
unset( $actions[ $key ] );
669+
// Add action links only if the user has the capability to perform the task.
670+
if ( $this->capability_required() ) {
671+
$actions = $this->add_task_actions( $data, $actions );
672+
foreach ( $actions as $key => $action ) {
673+
$actions[ $key ]['priority'] = $action['priority'] ?? 1000;
674+
if ( ! isset( $action['html'] ) || '' === $action['html'] ) {
675+
unset( $actions[ $key ] );
676+
}
674677
}
675678
}
676679

classes/suggested-tasks/providers/class-unpublished-content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public function add_task_actions( $data = [], $actions = [] ) {
348348

349349
$actions[] = [
350350
'priority' => 10,
351-
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( $data['meta']['prpl_url'] ) . '" target="_self">' . \esc_html__( 'Publish', 'progress-planner' ) . '</a>',
351+
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( $data['meta']['prpl_url'] ) . '" target="_blank">' . \esc_html__( 'Publish', 'progress-planner' ) . '</a>',
352352
];
353353

354354
return $actions;

0 commit comments

Comments
 (0)