Name the destination page in the continue link
CI / Tests (PHP 8.1) (pull_request) Successful in 49s
CI / Coding Standards (pull_request) Successful in 3m0s
CI / PHPStan (pull_request) Successful in 2m50s
CI / Tests (PHP 8.2) (pull_request) Successful in 47s
CI / No Debug Code (pull_request) Successful in 2s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m43s
CI / Build Plugin Zip (pull_request) Skipped
CI / Tests (PHP 8.1) (pull_request) Successful in 49s
CI / Coding Standards (pull_request) Successful in 3m0s
CI / PHPStan (pull_request) Successful in 2m50s
CI / Tests (PHP 8.2) (pull_request) Successful in 47s
CI / No Debug Code (pull_request) Successful in 2s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m43s
CI / Build Plugin Zip (pull_request) Skipped
"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:
@@ -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>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user