Deprecated

This method has been deprecated.

AnsPress_Theme::wpseo_title( string $title )

Description #

Filter wpseo plugin title.

Parameters #

  • $title
    string (Required) Page title.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: includes/class-theme.php

	public static function wpseo_title( $title ) {
		if ( is_anspress() ) {
			remove_filter( 'wpseo_title', array(
				__CLASS__,
				'wpseo_title',
			));

			$new_title = ap_page_title();

			if ( strpos( $title, 'ANSPRESS_TITLE' ) !== false ) {
				$new_title = str_replace( 'ANSPRESS_TITLE', $new_title, $title ) . ' | ' . get_bloginfo( 'name' );
			} else {
				$new_title = $new_title . ' | ' . get_bloginfo( 'name' );
			}

			$new_title = apply_filters( 'ap_wpseo_title', $new_title );

			return $new_title;
		}

		return $title;
	}

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