General: Replace older-style PHP type conversion functions with type casts.

This improves performance, readability, and consistency throughout core.

* `intval()` → `(int)`
* `strval()` → `(string)`
* `floatval()` → `(float)`

Props ayeshrajans.
Fixes #42918.

git-svn-id: https://develop.svn.wordpress.org/trunk@49108 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-10-08 21:13:57 +00:00
parent eeae797340
commit 79703088c4
94 changed files with 306 additions and 307 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ class Test_WP_Customize_Partial extends WP_UnitTestCase {
*/
function render_post_content_partial( $partial ) {
$id_data = $partial->id_data();
$post_id = intval( $id_data['keys'][0] );
$post_id = (int) $id_data['keys'][0];
if ( empty( $post_id ) ) {
return false;
}