AnsPress_Category::term_link_filter( string $url, object $term, string $taxonomy )
Description #
Filter category permalink.
Parameters #
- $urlstring (Required) Default taxonomy url.
- $termobject (Required) WordPress term object.
- $taxonomystring (Required) Current taxonomy slug.
Source #
File: addons/free/category.php
public static function term_link_filter( $url, $term, $taxonomy ) { if ( 'question_category' === $taxonomy ) { if ( get_option( 'permalink_structure' ) != '' ) { $opt = get_option( 'ap_categories_path', 'categories' ); return home_url( $opt ) . '/' . $term->slug . '/'; } else { return add_query_arg( [ 'ap_page' => 'category', 'question_category' => $term->slug ], home_url() ); } } return $url; }
Expand full source code Collapse full source code View on GitHub: addons/free/category.php:356
Add your comment