Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #57966, comment 5


Ignore:
Timestamp:
03/31/2023 08:17:46 PM (23 months ago)
Author:
joemcgill
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57966, comment 5

    initial v1  
    1 At minimum, it looks like the first approach makes sense to me. We're only calling `get_term` to make sure an error isn't thrown before adding the term ID to the queue. One interesting behavior of get_term is that if it is past an object instead of an ID, it will apply raw filtering, which may already be more performant in scenarios like this than passing an ID which requires a new `WP_Term` instance to be generated and sanitized.
     1At minimum, it looks like the first approach makes sense to me. We're only calling `get_term` to make sure an error isn't thrown before adding the term ID to the queue. One interesting behavior of `get_term` is that if it is passed an object instead of an ID, it will apply raw filtering, which may already be more performant in scenarios like this than passing an ID which requires a new `WP_Term` instance to be generated and sanitized.
    22
    33Since we're not making use of any of those fields, but instead are only worried about adding the IDs to the queue, I think ignoring sanitation here is totally fine, and is in line with how this was functioning prior to the changes made in [55252].