Filters the category link.
Parameters
$termlink
string- Category link URL.
$term_id
int- Term ID.
Source
$termlink = apply_filters( 'category_link', $termlink, $term->term_id );
Changelog
Version | Description |
---|---|
5.4.1 | Restored (un-deprecated). |
2.5.0 | Deprecated in favor of 'term_link' filter. |
1.5.0 | Introduced. |
WordPress hooks provide a powerful way to modify and extend the core functionality of your site. The
apply_filters()
function is used to apply filters to a variable, allowing you to modify data before it is used. Thecategory_link
filter specifically allows you to alter the URL of a category link before it is displayed.Simple Examples
Complex Examples
By using
apply_filters()
with thecategory_link
filter, you can easily customize the URLs of category links in WordPress. This technique allows you to tailor category links to meet your specific needs.