Two of the Gutenberg blocks render links whose targets cannot be configured:
The Lesson Booking block (us-scheduler/booking) shows a "log in to book a lesson" link to logged-out visitors. It always points at the WordPress login screen (wp-login.php), even when the site has a front-end student login page.
The Student Login block (us-scheduler/student-login) shows a "View available lessons" link to visitors who are already logged in. It points at the login page itself, so it effectively goes nowhere.
Proposed behaviour
The booking block gets a Login page option (dropdown of published pages) controlling where the log-in link sends logged-out visitors. Default stays the WordPress login screen.
The student-login block gets a Booking page option controlling where the logged-in link points and where students land after logging in. Default stays the current page.
Both blocks get an auto-redirect toggle, off by default: instead of showing the link, logged-out visitors on the booking page are redirected to the login page, and logged-in visitors on the login page are redirected to the booking page.
Related bug found during implementation
Using any of the four shortcodes bare (e.g. [us_booking] with no attributes) throws a TypeError: WordPress core's shortcode_parse_atts('') passes an empty string where the strictly-typed render(array $atts) methods expect an array. The shortcode callbacks need to normalize non-array attribute values.
## Problem
Two of the Gutenberg blocks render links whose targets cannot be configured:
- The **Lesson Booking** block (`us-scheduler/booking`) shows a "log in to book a lesson" link to logged-out visitors. It always points at the WordPress login screen (`wp-login.php`), even when the site has a front-end student login page.
- The **Student Login** block (`us-scheduler/student-login`) shows a "View available lessons" link to visitors who are already logged in. It points at the login page itself, so it effectively goes nowhere.
## Proposed behaviour
- The booking block gets a **Login page** option (dropdown of published pages) controlling where the log-in link sends logged-out visitors. Default stays the WordPress login screen.
- The student-login block gets a **Booking page** option controlling where the logged-in link points and where students land after logging in. Default stays the current page.
- Both blocks get an **auto-redirect** toggle, **off by default**: instead of showing the link, logged-out visitors on the booking page are redirected to the login page, and logged-in visitors on the login page are redirected to the booking page.
## Related bug found during implementation
Using any of the four shortcodes bare (e.g. `[us_booking]` with no attributes) throws a TypeError: WordPress core's `shortcode_parse_atts('')` passes an empty string where the strictly-typed `render(array $atts)` methods expect an array. The shortcode callbacks need to normalize non-array attribute values.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Two of the Gutenberg blocks render links whose targets cannot be configured:
us-scheduler/booking) shows a "log in to book a lesson" link to logged-out visitors. It always points at the WordPress login screen (wp-login.php), even when the site has a front-end student login page.us-scheduler/student-login) shows a "View available lessons" link to visitors who are already logged in. It points at the login page itself, so it effectively goes nowhere.Proposed behaviour
Related bug found during implementation
Using any of the four shortcodes bare (e.g.
[us_booking]with no attributes) throws a TypeError: WordPress core'sshortcode_parse_atts('')passes an empty string where the strictly-typedrender(array $atts)methods expect an array. The shortcode callbacks need to normalize non-array attribute values.