mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 06:05:42 +00:00
Coding Standards: Use strict type check for in_array() and array_search() where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50. Includes minor code layout fixes for better readability. See #49542. git-svn-id: https://develop.svn.wordpress.org/trunk@47550 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1157,7 +1157,7 @@ final class WP_Screen {
|
||||
|
||||
foreach ( $columns as $column => $title ) {
|
||||
// Can't hide these for they are special.
|
||||
if ( in_array( $column, $special ) ) {
|
||||
if ( in_array( $column, $special, true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1174,7 +1174,7 @@ final class WP_Screen {
|
||||
|
||||
$id = "$column-hide";
|
||||
echo '<label>';
|
||||
echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />';
|
||||
echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $column, $hidden, true ), true, false ) . ' />';
|
||||
echo "$title</label>\n";
|
||||
}
|
||||
?>
|
||||
@@ -1310,7 +1310,7 @@ final class WP_Screen {
|
||||
*/
|
||||
$view_mode_post_types = apply_filters( 'view_mode_post_types', $view_mode_post_types );
|
||||
|
||||
if ( ! in_array( $this->post_type, $view_mode_post_types ) ) {
|
||||
if ( ! in_array( $this->post_type, $view_mode_post_types, true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user