Skip to content

Commit b45c581

Browse files
committed
Update description for the "Sample Page" task
1 parent 66450f8 commit b45c581

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

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

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

98110
/**

0 commit comments

Comments
 (0)