IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 1338 | 1338 | |
| 1339 | 1339 | return $r; |
| 1340 | 1340 | } |
| | 1341 | |
| | 1342 | /** |
| | 1343 | * Check if the current post has any of given terms of taxonomy. |
| | 1344 | * |
| | 1345 | * @since 4.6.0 |
| | 1346 | * |
| | 1347 | * @param string $taxonomy Taxonomy name. |
| | 1348 | * @param int|object $post_id Optional. Post to check instead of the current post. |
| | 1349 | * @return bool True if the current post has any of the given terms of taxonomy. |
| | 1350 | */ |
| | 1351 | function has_terms($taxonomy, $post_id = null){ |
| | 1352 | $terms = get_the_terms( $post_id, $taxonomy ); |
| | 1353 | |
| | 1354 | return ! ( is_wp_error( $terms ) || empty( $terms ) ); |
| | 1355 | } |