[wp-trac] [WordPress Trac] #37042: Additional filter for has_category function
WordPress Trac
noreply at wordpress.org
Tue Jun 7 07:27:27 UTC 2016
#37042: Additional filter for has_category function
-----------------------------+-----------------------------
Reporter: jakubbis | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.5.2
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
Our plugin translates categories and posts. Let's assume we have two
languages:
- original: English
- second: French
We defined category "test" and its translation "test-fr". The category is
assigned to the post in such way that English post has English category
and vice versa.
Currently, when we call has_category("test") in single.php file, it
returns true only for the English post ( because French one does not have
"test" category but "test-fr" ). We expect that result will be true in
both cases.
----
For this reason, we need some filter inside ''is_object_in_term''
function, similar to "get_object_terms" inside "wp_get_object_terms"
function. It will give as opportunity to adjust "has_category" behaviour
to out requirements.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37042>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list