Opened 9 years ago
Last modified 4 years ago
#35385 new enhancement
Able to get raw content by calling get_the_archive_description
Reported by: | wido | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch has-unit-tests |
Focuses: | template | Cc: |
Description
Calling the get_the_archive_description the content will be passed to some filters by the sanitize_term_field function, one of them is wpautop.
To add some class to the p tag the only way is to perform a preg_replace but that can create issue with other callbacks hooked into 'get_the_archive_description'.
Would be great to have a param like $context as the get_term_field has to able to pass raw and retrieve only the text.
Attachments (3)
Change History (10)
#3
@
5 years ago
Instead of context I thought to introduce a boolean parameter which simply return the raw version of the description.
A filter has been added to be able to filter the description before it's returned.
I think a boolean introduce less complexity than a string since it's just a toggle action.
More over, I guess we could introduce a new function instead of passing a parameter, something like get_raw_post_type_archive_description
which could be called by get_the_post_type_description
, this way we do not introduce parameters making the function more clear and simple to call.
This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.
4 years ago
#6
follow-up:
↓ 7
@
4 years ago
@wido I notice the patch introduces a boolean $raw
parameter - perhaps it would be better to use a string $context
as that can be extended later to accept additional values. Plus it's more consistent with get_term_field()
which you referenced in your initial report.
#7
in reply to:
↑ 6
@
4 years ago
Replying to markparnell:
@wido I notice the patch introduces a boolean
$raw
parameter - perhaps it would be better to use a string$context
as that can be extended later to accept additional values. Plus it's more consistent withget_term_field()
which you referenced in your initial report.
Please have a look at https://core.trac.wordpress.org/ticket/35385#comment:3
Introduce additional parameter to get the raw version of the post type archive description