File tree Expand file tree Collapse file tree 6 files changed +15
-17
lines changed
Expand file tree Collapse file tree 6 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const filesToUpdate = [
4040 } ,
4141 {
4242 file : path . join ( rootDir , '{{slug}}.php' ) ,
43- pattern : / d e f i n e \( \s * ' { { n a m e s p a c e \| u p p e r } } _ V E R S I O N ' , \s * ' [ ^ ' ] + ' \s * \) / ,
43+ pattern : / d e f i n e \( \s * ' \{ \ {n a m e s p a c e \| u p p e r \} \ }_ V E R S I O N ' , \s * ' [ ^ ' ] + ' \s * \) / ,
4444 replacement : `define( '{{namespace|upper}}_VERSION', '${ newVersion } ' )` ,
4545 } ,
4646] ;
Original file line number Diff line number Diff line change 104104 }
105105
106106 dots . forEach ( function ( dot , index ) {
107- const dotIndex = index * settings . slidesToScroll ;
108- const isActive = currentIndex >= dotIndex &&
109- currentIndex < dotIndex + settings . slidesToScroll ;
110-
111- dot . classList . toggle ( 'is-active' , isActive || index === Math . floor ( currentIndex / settings . slidesToScroll ) ) ;
112- dot . setAttribute ( 'aria-selected' , dot . classList . contains ( 'is-active' ) ) ;
107+ const isActive = index === Math . floor ( currentIndex / settings . slidesToScroll ) ;
108+ dot . classList . toggle ( 'is-active' , isActive ) ;
109+ dot . setAttribute ( 'aria-selected' , isActive . toString ( ) ) ;
113110 } ) ;
114111 }
115112
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ export default function Gallery( {
8989 role = "dialog"
9090 aria-modal = "true"
9191 aria-label = { __ ( 'Image lightbox' , '{{textdomain}}' ) }
92+ tabIndex = { - 1 }
93+ ref = { ( el ) => el && el . focus ( ) }
9294 style = { {
9395 position : 'fixed' ,
9496 inset : 0 ,
@@ -97,6 +99,7 @@ export default function Gallery( {
9799 alignItems : 'center' ,
98100 justifyContent : 'center' ,
99101 zIndex : 99999 ,
102+ outline : 'none' ,
100103 } }
101104 >
102105 < img
Original file line number Diff line number Diff line change @@ -198,15 +198,15 @@ export default function Slider( {
198198 role = "tablist"
199199 aria-label = { __ ( 'Slider navigation' , '{{textdomain}}' ) }
200200 >
201- { Array . from ( { length : maxIndex + 1 } ) . map ( ( _ , index ) => (
201+ { Array . from ( { length : Math . ceil ( ( totalSlides - slidesToShow ) / slidesToScroll ) + 1 } ) . map ( ( _ , index ) => (
202202 < button
203203 key = { index }
204204 className = { `{{namespace}}-slider__dot ${
205- index === currentIndex ? 'is-active' : ''
205+ index === Math . floor ( currentIndex / slidesToScroll ) ? 'is-active' : ''
206206 } ` }
207- onClick = { ( ) => goToSlide ( index ) }
207+ onClick = { ( ) => goToSlide ( index * slidesToScroll ) }
208208 role = "tab"
209- aria-selected = { index === currentIndex }
209+ aria-selected = { index === Math . floor ( currentIndex / slidesToScroll ) }
210210 aria-label = { `Go to slide ${ index + 1 } ` }
211211 />
212212 ) ) }
Original file line number Diff line number Diff line change @@ -87,10 +87,8 @@ export function buildTaxQuery( taxQuery ) {
8787 }
8888
8989 return [
90- {
91- relation : 'AND' ,
92- ...queries ,
93- } ,
90+ { relation : 'AND' } ,
91+ ...queries ,
9492 ] ;
9593}
9694
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ public function test_can_delete_terms() {
5252 // Delete term.
5353 wp_delete_term ( $ term ['term_id ' ], '{{slug}}_category ' );
5454
55- // Verify deletion.
55+ // Verify deletion - get_term returns WP_Error or null when term doesn't exist .
5656 $ deleted_term = get_term ( $ term ['term_id ' ], '{{slug}}_category ' );
57- $ this ->assertNull ( $ deleted_term );
57+ $ this ->assertTrue ( is_wp_error ( $ deleted_term ) || null === $ deleted_term );
5858 }
5959
6060 /**
You can’t perform that action at this time.
0 commit comments