published( 3 ); if ( ! $pages ) { echo '
' . esc_html__( 'Your booking form is not on a published page yet. Publish it to get a link and a QR code to share.', 'abientot' ) . '
'; if ( current_user_can( 'edit_pages' ) ) { $url = add_query_arg( array( 'post_type' => 'page', 'post_title' => rawurlencode( __( 'Book an appointment', 'abientot' ) ), 'content' => rawurlencode( '[abientot_booking_form]' ), // WordPress escapes prefilled content, so a block comment would not survive. ), admin_url( 'post-new.php' ) ); echo '' . esc_html__( 'Create a booking page', 'abientot' ) . '
'; } echo '' . esc_html__( 'You can also add the shortcode [abientot_booking_form] or the Abientot Booking Form block to any page.', 'abientot' ) . '
'; return; } foreach ( $pages as $page ) { self::link( '' !== $page['title'] ? $page['title'] : __( 'Booking page', 'abientot' ), $page['url'], true ); } echo ''; } /** * One shareable link with its copy and QR code buttons. A booking page's block also runs * `abientot_share_kit_page` with its URL (Pro adds a link for each location there). */ public static function link( string $title, string $url, bool $page = false ): void { echo ''; } }