AnsPress_Tag::term_link_filter( string $url, array $term, string $taxonomy )

Description #

Filter tag term link.

Parameters #

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

Source #

File: addons/free/tag.php

	public static function term_link_filter( $url, $term, $taxonomy ) {
		if ( 'question_tag' === $taxonomy ) {
			if ( get_option( 'permalink_structure' ) != '' ) {
				$opt = get_option( 'ap_tags_path', 'tags' );
				return home_url( $opt ) . '/' . $term->slug . '/';
			} else {
				return add_query_arg( [ '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