@@ -413,7 +413,7 @@ public function create_item( $request ) {
413413
414414 if ( is_wp_error ( $ post_id ) ) {
415415
416- if ( in_array ( $ post_id ->get_error_code (), array ( 'db_insert_error ' ) ) ) {
416+ if ( in_array ( $ post_id ->get_error_code (), array ( 'db_insert_error ' ), true ) ) {
417417 $ post_id ->add_data ( array ( 'status ' => 500 ) );
418418 } else {
419419 $ post_id ->add_data ( array ( 'status ' => 400 ) );
@@ -526,7 +526,7 @@ public function update_item( $request ) {
526526 // convert the post object to an array, otherwise wp_update_post will expect non-escaped input
527527 $ post_id = wp_update_post ( (array ) $ post , true );
528528 if ( is_wp_error ( $ post_id ) ) {
529- if ( in_array ( $ post_id ->get_error_code (), array ( 'db_update_error ' ) ) ) {
529+ if ( in_array ( $ post_id ->get_error_code (), array ( 'db_update_error ' ), true ) ) {
530530 $ post_id ->add_data ( array ( 'status ' => 500 ) );
531531 } else {
532532 $ post_id ->add_data ( array ( 'status ' => 400 ) );
@@ -1021,7 +1021,7 @@ protected function handle_featured_media( $featured_media, $post_id ) {
10211021 * @param integer $post_id
10221022 */
10231023 public function handle_template ( $ template , $ post_id ) {
1024- if ( in_array ( $ template , array_keys ( wp_get_theme ()->get_page_templates ( $ this ->get_post ( $ post_id ) ) ) ) ) {
1024+ if ( in_array ( $ template , array_keys ( wp_get_theme ()->get_page_templates ( $ this ->get_post ( $ post_id ) ) ), true ) ) {
10251025 update_post_meta ( $ post_id , '_wp_page_template ' , $ template );
10261026 } else {
10271027 update_post_meta ( $ post_id , '_wp_page_template ' , '' );
@@ -1375,15 +1375,15 @@ protected function prepare_links( $post ) {
13751375 ),
13761376 );
13771377
1378- if ( ( in_array ( $ post ->post_type , array ( 'post ' , 'page ' ) ) || post_type_supports ( $ post ->post_type , 'author ' ) )
1378+ if ( ( in_array ( $ post ->post_type , array ( 'post ' , 'page ' ), true ) || post_type_supports ( $ post ->post_type , 'author ' ) )
13791379 && ! empty ( $ post ->post_author ) ) {
13801380 $ links ['author ' ] = array (
13811381 'href ' => rest_url ( 'wp/v2/users/ ' . $ post ->post_author ),
13821382 'embeddable ' => true ,
13831383 );
13841384 };
13851385
1386- if ( in_array ( $ post ->post_type , array ( 'post ' , 'page ' ) ) || post_type_supports ( $ post ->post_type , 'comments ' ) ) {
1386+ if ( in_array ( $ post ->post_type , array ( 'post ' , 'page ' ), true ) || post_type_supports ( $ post ->post_type , 'comments ' ) ) {
13871387 $ replies_url = rest_url ( 'wp/v2/comments ' );
13881388 $ replies_url = add_query_arg ( 'post ' , $ post ->ID , $ replies_url );
13891389 $ links ['replies ' ] = array (
@@ -1392,7 +1392,7 @@ protected function prepare_links( $post ) {
13921392 );
13931393 }
13941394
1395- if ( in_array ( $ post ->post_type , array ( 'post ' , 'page ' ) ) || post_type_supports ( $ post ->post_type , 'revisions ' ) ) {
1395+ if ( in_array ( $ post ->post_type , array ( 'post ' , 'page ' ), true ) || post_type_supports ( $ post ->post_type , 'revisions ' ) ) {
13961396 $ links ['version-history ' ] = array (
13971397 'href ' => rest_url ( trailingslashit ( $ base ) . $ post ->ID . '/revisions ' ),
13981398 );
@@ -1413,7 +1413,7 @@ protected function prepare_links( $post ) {
14131413 'embeddable ' => true ,
14141414 );
14151415 }
1416- if ( ! in_array ( $ post ->post_type , array ( 'attachment ' , 'nav_menu_item ' , 'revision ' ) ) ) {
1416+ if ( ! in_array ( $ post ->post_type , array ( 'attachment ' , 'nav_menu_item ' , 'revision ' ), true ) ) {
14171417 $ attachments_url = rest_url ( 'wp/v2/media ' );
14181418 $ attachments_url = add_query_arg ( 'parent ' , $ post ->ID , $ attachments_url );
14191419 $ links ['https://api.w.org/attachment ' ] = array (
@@ -1600,9 +1600,9 @@ public function get_item_schema() {
16001600 ),
16011601 );
16021602 foreach ( $ post_type_attributes as $ attribute ) {
1603- if ( isset ( $ fixed_schemas [ $ this ->post_type ] ) && ! in_array ( $ attribute , $ fixed_schemas [ $ this ->post_type ] ) ) {
1603+ if ( isset ( $ fixed_schemas [ $ this ->post_type ] ) && ! in_array ( $ attribute , $ fixed_schemas [ $ this ->post_type ], true ) ) {
16041604 continue ;
1605- } elseif ( ! in_array ( $ this ->post_type , array_keys ( $ fixed_schemas ) ) && ! post_type_supports ( $ this ->post_type , $ attribute ) ) {
1605+ } elseif ( ! in_array ( $ this ->post_type , array_keys ( $ fixed_schemas ), true ) && ! post_type_supports ( $ this ->post_type , $ attribute ) ) {
16061606 continue ;
16071607 }
16081608
0 commit comments