Skip to content

Commit f27dd34

Browse files
committed
Address copilot review
1 parent 08e96f0 commit f27dd34

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

assets/src/js/bindings/hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function usePostEditorFields() {
7878
Object.entries( record.acf ).forEach( ( [ key, value ] ) => {
7979
if ( key.endsWith( '_source' ) ) {
8080
const baseFieldName = key.replace( '_source', '' );
81-
if ( record.acf.hasOwnProperty( baseFieldName ) ) {
81+
if ( Object.hasOwn( record.acf, baseFieldName ) ) {
8282
sourcedFields[ baseFieldName ] = value;
8383
}
8484
}

includes/rest-api/class-acf-rest-types-endpoint.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ private function get_source_post_types( $source ) {
162162
array_keys( get_post_types( array(), 'objects' ) ),
163163
array_merge( $core_types, $scf_types )
164164
);
165-
default:
166-
return array();
167165
}
168166
}
169167

0 commit comments

Comments
 (0)