@@ -1374,7 +1374,7 @@ public function get_index( $request ) {
13741374
13751375 $ response = new WP_REST_Response ( $ available );
13761376
1377- $ fields = isset ( $ request ['_fields ' ] ) ? $ request [ ' _fields ' ] : '' ;
1377+ $ fields = $ request ['_fields ' ] ?? '' ;
13781378 $ fields = wp_parse_list ( $ fields );
13791379 if ( empty ( $ fields ) ) {
13801380 $ fields [] = '_links ' ;
@@ -1618,7 +1618,7 @@ public function get_data_for_route( $route, $callbacks, $context = 'view' ) {
16181618 $ data ['namespace ' ] = $ options ['namespace ' ];
16191619 }
16201620
1621- $ allow_batch = isset ( $ options ['allow_batch ' ] ) ? $ options [ ' allow_batch ' ] : false ;
1621+ $ allow_batch = $ options ['allow_batch ' ] ?? false ;
16221622
16231623 if ( isset ( $ options ['schema ' ] ) && 'help ' === $ context ) {
16241624 $ data ['schema ' ] = call_user_func ( $ options ['schema ' ] );
@@ -1640,7 +1640,7 @@ public function get_data_for_route( $route, $callbacks, $context = 'view' ) {
16401640 'methods ' => array_keys ( $ callback ['methods ' ] ),
16411641 );
16421642
1643- $ callback_batch = isset ( $ callback ['allow_batch ' ] ) ? $ callback [ ' allow_batch ' ] : $ allow_batch ;
1643+ $ callback_batch = $ callback ['allow_batch ' ] ?? $ allow_batch ;
16441644
16451645 if ( $ callback_batch ) {
16461646 $ endpoint_data ['allow_batch ' ] = $ callback_batch ;
@@ -1722,7 +1722,7 @@ public function serve_batch_request_v1( WP_REST_Request $batch_request ) {
17221722 continue ;
17231723 }
17241724
1725- $ single_request = new WP_REST_Request ( isset ( $ args ['method ' ] ) ? $ args [ ' method ' ] : 'POST ' , $ parsed_url ['path ' ] );
1725+ $ single_request = new WP_REST_Request ( $ args ['method ' ] ?? 'POST ' , $ parsed_url ['path ' ] );
17261726
17271727 if ( ! empty ( $ parsed_url ['query ' ] ) ) {
17281728 $ query_args = array ();
@@ -1767,7 +1767,7 @@ public function serve_batch_request_v1( WP_REST_Request $batch_request ) {
17671767 $ allow_batch = $ handler ['allow_batch ' ];
17681768 } else {
17691769 $ route_options = $ this ->get_route_options ( $ route );
1770- $ allow_batch = isset ( $ route_options ['allow_batch ' ] ) ? $ route_options [ ' allow_batch ' ] : false ;
1770+ $ allow_batch = $ route_options ['allow_batch ' ] ?? false ;
17711771 }
17721772
17731773 if ( ! is_array ( $ allow_batch ) || empty ( $ allow_batch ['v1 ' ] ) ) {
0 commit comments