From 0b9c78742a9523245e37e1f3869f8717bd5ce599 Mon Sep 17 00:00:00 2001 From: Tony Blacker Date: Thu, 4 Feb 2021 08:51:33 +0000 Subject: [PATCH] final release mods (code standards, release notes) --- inc/breadcrumbs.php | 27 +++---- inc/gravity-forms.php | 133 ++++++++++++++++---------------- readme.txt | 45 ++++++----- searchform.php | 1 + template-parts/content-post.php | 20 ++--- 5 files changed, 118 insertions(+), 108 deletions(-) diff --git a/inc/breadcrumbs.php b/inc/breadcrumbs.php index f9243bee..9249bf23 100644 --- a/inc/breadcrumbs.php +++ b/inc/breadcrumbs.php @@ -1,25 +1,23 @@ ' . $name . $separator . ''; } + return $chain; } @@ -87,9 +86,9 @@ function nightingale_breadcrumb() { if ( true === nightingale_uncanny_breadcrumb_check() ) { $breadcrumbs = uo_breadcrumbs( false ); } else { - $back_one_level = empty( $back_one_level ) ? array( esc_url( home_url() ), __( 'Home', 'nightingale' ) ) : $back_one_level; + $back_one_level = empty( $back_one_level ) ? array( esc_url( home_url() ), __( 'Home', 'nightingale' ) ) : $back_one_level; list( $trail, $back_one_level ) = nightingale_breadcrumb_trail(); - $breadcrumbs = sprintf( + $breadcrumbs = sprintf( '
  1. %3$s
  2. %1$s
', $trail, esc_url( home_url() ), @@ -121,6 +120,7 @@ function nightingale_breadcrumb() { ); $output = ob_get_clean(); + return $output; } @@ -174,7 +174,7 @@ function nightingale_breadcrumb_trail() { $home_page = get_option( 'page_on_front' ); foreach ( $ancestors as $ancestor ) { if ( ( end( $ancestors ) !== $ancestor ) && ( ( $home_page !== $ancestor ) ) ) { - $trail .= '
  • ' . esc_html( wp_strip_all_tags( apply_filters( 'single_post_title', get_the_title( $ancestor ) ) ) ) . '
  • '; + $trail .= '
  • ' . esc_html( wp_strip_all_tags( apply_filters( 'single_post_title', get_the_title( $ancestor ) ) ) ) . '
  • '; $back_one_level = array( esc_url( get_permalink( $ancestor ) ), wp_strip_all_tags( apply_filters( 'single_post_title', get_the_title( $ancestor ) ) ), @@ -189,5 +189,6 @@ function nightingale_breadcrumb_trail() { if ( ! ( is_archive() || is_category() || is_post_type_archive() || is_search() || is_404() || is_singular( 'tribe_events' ) ) ) { $trail .= '
  • ' . esc_html( get_the_title() ) . '
  • '; } + return array( apply_filters( 'nightingale_modify_breadcrumb', $trail ), $back_one_level ); } diff --git a/inc/gravity-forms.php b/inc/gravity-forms.php index f1e41db6..d01c1df2 100644 --- a/inc/gravity-forms.php +++ b/inc/gravity-forms.php @@ -10,47 +10,47 @@ * @package Nightingale Theme */ - - add_filter( - 'gform_get_form_filter', - function ( $form_string, $form ) { - // Replace form description span with elements. - $form_string = preg_replace( "#(.*?)#", '$1', $form_string ); - // Style error messages. - // Message at top of form. - $form_string = str_replace( 'validation_error', 'nhsuk-error-message is-error', $form_string ); - // Fields with CSS class = "gfield_error". - $form_string = str_replace( 'gfield_error', 'is-error gfield_error', $form_string ); - // Fields contained in
  • elements that have CSS class = "gfield_error". - $form_string = preg_replace( "#. - $form_string = str_replace( "class='gform_fields", "class='c-form-list gform_fields", $form_string ); - // Replace

    with

    . - $form_string = str_replace( '', '/h2>', $form_string ); - // Replace field description divs with elements. - $form_string = preg_replace( "#
    #", "", $form_string ); - // Replace field instruction divs with elements. - $form_string = preg_replace( "#
    $2', $form_string ); - // Remove "required" tag NHSUK Service manual insted recommends highlighting optional fields, which is done elsewhere. - $form_string = str_replace( "*", '', $form_string ); - // Replace main gfield_label elements with nhsuk-label. - $form_string = preg_replace( '#gfield_label#s', 'nhsuk-label', $form_string ); - // Remove
    #"; // strip out all the table gunk. + $replace[] = "
    $1$likertlabel
    $4
    $5
    "; // replace it with a much simpler div layout. + $find[] = '#(.*?)#'; + $replace[] = "
    $2
    "; + $find[] = "#
    (.*?)(.*?)(.*?)
    #"; // identify multi row tables. + $replace[] = "
    $1$3$4
    "; + $find[] = "#(.*?)(.*?)#"; // modify multi row grids. + $replace[] = "
    $2
    $3
    "; + $find[] = '#(.*?)#'; // now mop up the single row grids. + $replace[] = "
    $1
    "; + $find[] = "##"; // we just have to pull out the td's now. + $replace[] = "
    "; // and turn them into pretty divs with nhsuk-radios. - $field_content = preg_replace( $find, $replace, $field_content ); + $field_content = preg_replace( $find, $replace, $field_content ); break; // Name inputs. case 'name': @@ -363,7 +362,7 @@ function nightingale_gwp_days( $expiration_days ) { * @return string */ function nightingale_change_upload_markup( $file_upload_markup, $file_info, $form_id, $field_id ) { - return '' . esc_html( $file_info[ 'uploaded_filename' ] ) . " ' . esc_html( $file_info['uploaded_filename'] ) . " Delete this file"; } diff --git a/readme.txt b/readme.txt index ba5bc160..bf249c90 100644 --- a/readme.txt +++ b/readme.txt @@ -43,25 +43,34 @@ one level only. To show further levels, we recommend using the right (or left) h == Changelog = 2.3.1 = - Accessibility Improvements: -* Multiple contrast issues addressed, especially in plugin compatability (Gravity Forms, The Events Calendar, LearnDash - in particular) -* Keyboard navigation improvements to all screens -* Screen reader enhancements added to multiple posts view, header component and to footer region -* Mobile navigation focus enhanecement for visually impaired users -* form and search input field focus effect amended to use both yellow and black so contrast is maintained regardless of -background colour - -Base library upgraded to NHSUK Frontend 4.1 (https://github.com/nhsuk/nhsuk-frontend/blob/v4.1.0/) - -Functional improvements: -* new thumbnails added for theme to create square images. Optional on blog listing pages to then use these for +* Accessibility Improvements: + * Multiple contrast issues addressed, especially in plugin compatability (Gravity Forms, The Events Calendar, + LearnDash in particular) + * Aria roles corrected + * Keyboard navigation improvements to all screens + * Screen reader enhancements added to multiple posts view, header component and to footer region + * Mobile navigation focus enhanecement for visually impaired users + * form and search input field focus effect amended to use both yellow and black so contrast is maintained regardless + of background colour +* Base library upgraded to NHSUK Frontend 4.1 (https://github.com/nhsuk/nhsuk-frontend/blob/v4.1.0/) +* Logo / site title hover effect remedied to be in line with nhsuk framework +* Improvements to IE10/11 support +* Search improvements - particularly on mobile where clicking to open search now focuses inside the search box. +* Various improvements to Gravity Forms integration: + * Likert icon modified to match rest of radio displays (also improves contrast and accessibility) + * Likert display modified from tables to divs to be more responsive + * Likert labels next to each option as screen reader assists + * Radios - label modified to legend and bought inside fieldset +* Security tweaks: + * Author name hidden in rss feeds to reduce chance of enumeration + * Login hint messages modified to not reveal whether a username already exists +* Functional improvements: + * new thumbnails added for theme to create square images. Optional on blog listing pages to then use these for consistent sizing of blocks (default is to use standard image, but optional to amend to the new square layout) -* Multiple Gravity Forms layout improvements -* Learndash grid view added to theme (this only impacts if you have both LearnDash and LearnDash grid view plugins) -* Fix to nhsuk-card--clickable component so the whole region is selectable and clickable (also accessibility improvement - so when keyboard navigating, the whole region is indicated as selected) - + * Multiple Gravity Forms layout improvements + * Learndash grid view added to theme (this only impacts if you have both LearnDash and LearnDash grid view plugins) + * Fix to nhsuk-card--clickable component so the whole region is selectable and clickable (also accessibility + improvement so when keyboard navigating, the whole region is indicated as selected) = 2.3.0.1 = Bugfix release: diff --git a/searchform.php b/searchform.php index d9cd00dc..8a00765f 100644 --- a/searchform.php +++ b/searchform.php @@ -32,6 +32,7 @@ $search_form = 'id=search' . $searchid . ''; $search_field = 'search-field' . $searchid; } + /* * The nhsuk library does a call home to nhs.funnelback.co.uk to provide search suggestions from nhs.uk website. * We dont want that happening. Currently the only disabling is to manually rework nhsuk.js.min to remove the callback. diff --git a/template-parts/content-post.php b/template-parts/content-post.php index 64320b58..9c59a44a 100644 --- a/template-parts/content-post.php +++ b/template-parts/content-post.php @@ -66,15 +66,15 @@

    - start_date ); - $event_date = date( 'd M Y', $event_date ); - echo '(' . esc_html( $event_date ) . ')'; - } - ?> + start_date ); + $event_date = date( 'd M Y', $event_date ); + echo '(' . esc_html( $event_date ) . ')'; + } + ?>