Skip to content

Commit 66450f8

Browse files
committed
Update content for the "Hello World" task
1 parent 1c25f4a commit 66450f8

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,23 @@ protected function get_title() {
8989
* @return string
9090
*/
9191
protected function get_description() {
92-
return \sprintf(
93-
/* translators: %s:<a href="https://prpl.fyi/delete-hello-world-post" target="_blank">Hello World!</a> link */
94-
\esc_html__( 'On install, WordPress creates a %s post. This post is not needed and should be deleted.', 'progress-planner' ),
95-
'<a href="https://prpl.fyi/delete-hello-world-post" target="_blank">' . \esc_html__( '"Hello World!"', 'progress-planner' ) . '</a>'
96-
);
92+
$hello_world_post_id = $this->get_data_collector()->collect();
93+
94+
if ( 0 === $hello_world_post_id ) {
95+
return \esc_html__( 'On install, WordPress creates a "Hello World!" post. This post is not needed and should be deleted.', 'progress-planner' );
96+
}
97+
98+
$hello_world_post_url = \get_permalink( $hello_world_post_id );
99+
100+
return '<p>' . \sprintf(
101+
/* translators: %s: Link to the post. */
102+
\esc_html__( 'On install, WordPress creates a "Hello World!" post. You can find yours at %s.', 'progress-planner' ),
103+
'<a href="' . \esc_attr( $hello_world_post_url ) . '" target="_blank">' . \esc_html( $hello_world_post_url ) . '</a>',
104+
) . '</p><p>' . \sprintf(
105+
/* translators: %s: URL to https://prpl.fyi/delete-sample-page */
106+
\__( 'This post does not add value to your website and solely exists to show what a post can look like. Therefore, <a href="%s" target="_blank">"Hello World!" is not needed and should be deleted</a>.', 'progress-planner' ),
107+
'https://prpl.fyi/delete-hello-world-post'
108+
) . '</p>';
97109
}
98110

99111
/**

0 commit comments

Comments
 (0)