Skip to content

Commit eba9422

Browse files
committed
Merge remote-tracking branch 'origin/filip/v18/set-date-format' into filip/v18/set-date-format
2 parents 7d0116d + 943c093 commit eba9422

2 files changed

Lines changed: 26 additions & 36 deletions

File tree

classes/suggested-tasks/providers/class-set-date-format.php

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -112,39 +112,29 @@ public function should_add_task() {
112112
*/
113113
public function print_popover_instructions() {
114114
$detected_date_format = $this->get_date_format_type();
115-
116-
if ( 'wp_default' === $detected_date_format ) {
117-
echo '<p>';
118-
\esc_html_e( 'Choosing the right date format helps your visitors instantly understand when something was published without confusion or guessing. It also makes your site feel more familiar and trustworthy, especially if your audience is local.', 'progress-planner' );
119-
echo '</p>';
120-
echo '<p>';
121-
\esc_html_e( 'By setting the correct format, you make sure dates show up clearly both in your dashboard and on your live site.', 'progress-planner' );
122-
echo '</p>';
123-
echo '<p>';
124-
\esc_html_e( 'Tip: Pick the format that matches what your audience expects.', 'progress-planner' );
125-
echo '</p>';
126-
} elseif ( 'localized_default' === $detected_date_format ) {
127-
echo '<p>';
128-
\esc_html_e( 'Choosing the right date format helps your visitors instantly understand when something was published without confusion or guessing. It also makes your site feel more familiar and trustworthy, especially if your audience is local.', 'progress-planner' );
129-
echo '</p>';
130-
echo '<p>';
131-
/* translators: %s: The date format. */
132-
printf( \esc_html__( 'The date format currently set matches the default format for your site language (%s). Therefore, we expect it\'s set correctly. But can you have a quick look, just to be sure?', 'progress-planner' ), \esc_html( \get_option( 'date_format' ) ) );
133-
echo '</p>';
134-
echo '<p>';
135-
\esc_html_e( 'Tip: Pick the format that matches what your audience expects.', 'progress-planner' );
136-
echo '</p>';
137-
} else {
138-
echo '<p>';
139-
\esc_html_e( 'Choosing the right date format helps your visitors instantly understand when something was published without confusion or guessing. It also makes your site feel more familiar and trustworthy, especially if your audience is local.', 'progress-planner' );
140-
echo '</p>';
141-
echo '<p>';
142-
\esc_html_e( 'Because your site is not using the WordPress default setting, we expect you may have set this already. That\'s why we just want you to verify if it\'s set correctly.', 'progress-planner' );
143-
echo '</p>';
144-
echo '<p>';
145-
\esc_html_e( 'Tip: Pick the format that matches what your audience expects.', 'progress-planner' );
146-
echo '</p>';
147-
}
115+
?>
116+
<?php if ( 'wp_default' === $detected_date_format ) : ?>
117+
<p><?php \esc_html_e( 'Choosing the right date format helps your visitors instantly understand when something was published without confusion or guessing. It also makes your site feel more familiar and trustworthy, especially if your audience is local.', 'progress-planner' ); ?></p>
118+
<p><?php \esc_html_e( 'By setting the correct format, you make sure dates show up clearly both in your dashboard and on your live site.', 'progress-planner' ); ?></p>
119+
<p><?php \esc_html_e( 'Tip: Pick the format that matches what your audience expects.', 'progress-planner' ); ?></p>
120+
<?php elseif ( 'localized_default' === $detected_date_format ) : ?>
121+
<p><?php \esc_html_e( 'Choosing the right date format helps your visitors instantly understand when something was published without confusion or guessing. It also makes your site feel more familiar and trustworthy, especially if your audience is local.', 'progress-planner' ); ?></p>
122+
<p>
123+
<?php
124+
printf(
125+
/* translators: %s: The date format. */
126+
\esc_html__( 'The date format currently set matches the default format for your site language (%s). Therefore, we expect it\'s set correctly. But can you have a quick look, just to be sure?', 'progress-planner' ),
127+
\esc_html( \get_option( 'date_format' ) )
128+
);
129+
?>
130+
</p>
131+
<p><?php \esc_html_e( 'Tip: Pick the format that matches what your audience expects.', 'progress-planner' ); ?></p>
132+
<?php else : ?>
133+
<p><?php \esc_html_e( 'Choosing the right date format helps your visitors instantly understand when something was published without confusion or guessing. It also makes your site feel more familiar and trustworthy, especially if your audience is local.', 'progress-planner' ); ?></p>
134+
<p><?php \esc_html_e( 'Because your site is not using the WordPress default setting, we expect you may have set this already. That\'s why we just want you to verify if it\'s set correctly.', 'progress-planner' ); ?></p>
135+
<p><?php \esc_html_e( 'Tip: Pick the format that matches what your audience expects.', 'progress-planner' ); ?></p>
136+
<?php endif; ?>
137+
<?php
148138
}
149139

150140
/**

classes/update/class-update-161.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ private function migrate_task( $task ) {
101101
if ( 'user' === $task['provider_id'] ) {
102102
// User tasks have different data structure, so we can copy directly.
103103
$task_details = [
104-
'post_title' => $task['title'],
104+
'post_title' => isset( $task['title'] ) ? $task['title'] : '',
105105
'description' => '',
106-
'points' => $task['points'],
106+
'points' => isset( $task['points'] ) ? $task['points'] : 0,
107107
'provider_id' => 'user',
108108
'category' => 'user',
109-
'task_id' => $task['task_id'],
109+
'task_id' => isset( $task['task_id'] ) ? $task['task_id'] : '',
110110
'post_status' => 'pending' === $task['status'] ? 'publish' : $task['status'],
111111
'dismissable' => true,
112112
'snoozable' => false,

0 commit comments

Comments
 (0)