Deprecated

This method has been deprecated.

AnsPress_Category::ap_canonical_url( string $canonical_url )

Description #

Filter canonical URL when in category page.

Parameters #

  • $canonical_url
    string (Required) url.

Changelog #

VersionDescription
4.1.1Introduced.

Source #

File: addons/free/category.php

	public static function ap_canonical_url( $canonical_url ) {
		if ( is_question_category() ) {
			global $question_category;

			if ( ! $question_category ) {
				$question_category = get_queried_object();
			}

			return get_term_link( $question_category ); // @codingStandardsIgnoreLine.
		}

		return $canonical_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