2020-05-02 / 5265阅 / 悠然
Checks if the current post is within any of the given categories.
The given categories are checked against the post’s categories’ term_ids, names and slugs. Categories given as integers will> Conditional Tags article in the Theme Developer Handbook.
(int|string|array)
(Required)
Category ID, name or slug, or array of said.
(int|object)
(Optional)
Post to check instead of the current post. (since 2.7.0)
Default value: null
(bool) True if the current post is in any of the given categories.