Name the destination page in the continue link

"Continue to your account" says nothing about where the link goes. Use
the chosen page's own title instead — "Continue to Book a Lesson" — so
the visitor knows before clicking.

An untitled page keeps the generic wording rather than rendering
"Continue to ".
This commit is contained in:
2026-07-28 23:06:54 -03:00
parent 8a985f04d6
commit 7eb2afc6a3
3 changed files with 42 additions and 9 deletions
+22 -8
View File
@@ -351,8 +351,10 @@ class RegistrationPage {
}
/**
* The "continue to your account" paragraph shown to a logged-in visitor, or
* an empty string when no destination page is configured.
* The "continue" paragraph shown to a logged-in visitor, or an empty string
* when no destination page is configured. The link names the chosen page, so
* the visitor knows where it goes before clicking; an untitled page falls
* back to generic wording rather than reading "Continue to ".
*
* The sign-in-page fallback {@see loginUrl()} applies is deliberately not
* used here: pointing someone who is already signed in at the login screen is
@@ -361,13 +363,25 @@ class RegistrationPage {
* @param array<int|string, mixed> $atts
*/
private function continueLink( array $atts ): string {
$continue = $this->continueUrl( $this->successPageId( $atts ) );
$pageId = $this->successPageId( $atts );
$continue = $this->continueUrl( $pageId );
return null === $continue
? ''
: '<p><a href="' . esc_url( $continue ) . '">'
. esc_html__( 'Continue to your account', 'unsupervised-schedular' )
. '</a></p>';
if ( null === $continue ) {
return '';
}
$title = trim( Val::string( get_the_title( $pageId ) ) );
$label = '' === $title
? esc_html__( 'Continue to your account', 'unsupervised-schedular' )
: esc_html(
sprintf(
/* translators: %s: title of the page the student continues to. */
__( 'Continue to %s', 'unsupervised-schedular' ),
$title
)
);
return '<p><a href="' . esc_url( $continue ) . '">' . $label . '</a></p>';
}
/**