Tags::term_link_filter( string $url, object $term, string $taxonomy )

Description #

Filter tag term link.

Parameters #

  • $url
    string (Required) Default URL of taxonomy.
  • $term
    object (Required) Term array.
  • $taxonomy
    string (Required) Taxonomy type.

Source #

File: addons/tags/tags.php

	public function term_link_filter( $url, $term, $taxonomy ) {
		if ( 'question_tag' === $taxonomy ) {
			if ( get_option( 'permalink_structure' ) !== '' ) {
				$opt = get_option( 'ap_tags_path', 'tags' );
				return user_trailingslashit( home_url( $opt ) . '/' . $term->slug );
			} else {
				return add_query_arg(
					array(
						'ap_page'      => 'tag',
						'question_tag' => $term->slug,
					),
					home_url()
				);
			}
		}
		return $url;
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment