Coding Standards: Replace alias PHP functions with the canonical names.

Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.

This replaces all uses of the following:
* `join()` with `implode()`
* `sizeof()` with `count()`
* `is_writeable()` with `is_writable()`
* `doubleval()` with a `(float)` cast

In part, this is a follow-up to #47746.

Props jrf.
See #50767.

git-svn-id: https://develop.svn.wordpress.org/trunk@49193 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-10-18 17:25:10 +00:00
parent f124a650ba
commit 97b2f07d2e
61 changed files with 115 additions and 115 deletions

View File

@@ -1118,7 +1118,7 @@ function image_align_input_fields( $post, $checked = '' ) {
" /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>";
}
return join( "\n", $out );
return implode( "\n", $out );
}
/**
@@ -1195,7 +1195,7 @@ function image_size_input_fields( $post, $check = '' ) {
return array(
'label' => __( 'Size' ),
'input' => 'html',
'html' => join( "\n", $out ),
'html' => implode( "\n", $out ),
);
}
@@ -1424,7 +1424,7 @@ function get_attachment_fields_to_edit( $post, $errors = null ) {
$values[] = $term->slug;
}
$t['value'] = join( ', ', $values );
$t['value'] = implode( ', ', $values );
$form_fields[ $taxonomy ] = $t;
}
@@ -1784,7 +1784,7 @@ function get_media_item( $attachment_id, $args = null ) {
}
if ( ! empty( $field['helps'] ) ) {
$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';
$item .= "<p class='help'>" . implode( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';
}
$item .= "</td>\n\t\t</tr>\n";
@@ -1883,7 +1883,7 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
$values[] = $term->slug;
}
$t['value'] = join( ', ', $values );
$t['value'] = implode( ', ', $values );
$t['taxonomy'] = true;
$form_fields[ $taxonomy ] = $t;
@@ -1976,7 +1976,7 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
}
if ( ! empty( $field['helps'] ) ) {
$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';
$item .= "<p class='help'>" . implode( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';
}
$item .= "</td>\n\t\t</tr>\n";