[wp-trac] [WordPress Trac] #46346: WP_List_Table calculates total_pages as a float
WordPress Trac
noreply at wordpress.org
Wed Jan 27 23:53:19 UTC 2021
#46346: WP_List_Table calculates total_pages as a float
----------------------------------------+-----------------------------
Reporter: lev0 | Owner: SergeyBiryukov
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 5.7
Component: Administration | Version:
Severity: minor | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+-----------------------------
Comment (by lev0):
I don't have access to the affected code any more. All I remember is that
I used the total at the end of the table for something related to a
setting read from the options table, and it worked better using ints. I
was surprised that the type wasn't an int, so I wrote the patch.
From @SergeyBiryukov's comment:19:ticket:38266, it looks like WordPress
could do with a simple function to keep the code DRY, and replace `ceil()`
calls where one would expect an int returned, and avoid casting.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46346#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list