Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordpres.../src/presente...
File: title-presenter.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Presenters;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\SEO\Presentations\Indexable_Presentation;
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Presenter class for the document title.
[7] Fix | Delete
*/
[8] Fix | Delete
class Title_Presenter extends Abstract_Indexable_Tag_Presenter {
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* The tag key name.
[12] Fix | Delete
*
[13] Fix | Delete
* @var string
[14] Fix | Delete
*/
[15] Fix | Delete
protected $key = 'title';
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* The tag format including placeholders.
[19] Fix | Delete
*
[20] Fix | Delete
* @var string
[21] Fix | Delete
*/
[22] Fix | Delete
protected $tag_format = '<title>%s</title>';
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* The method of escaping to use.
[26] Fix | Delete
*
[27] Fix | Delete
* @var string
[28] Fix | Delete
*/
[29] Fix | Delete
protected $escaping = 'html';
[30] Fix | Delete
[31] Fix | Delete
/**
[32] Fix | Delete
* Gets the raw value of a presentation.
[33] Fix | Delete
*
[34] Fix | Delete
* @return string The raw value.
[35] Fix | Delete
*/
[36] Fix | Delete
public function get() {
[37] Fix | Delete
// This ensures backwards compatibility with other plugins using this filter as well.
[38] Fix | Delete
\add_filter( 'pre_get_document_title', [ $this, 'get_title' ], 15 );
[39] Fix | Delete
$title = \wp_get_document_title();
[40] Fix | Delete
\remove_filter( 'pre_get_document_title', [ $this, 'get_title' ], 15 );
[41] Fix | Delete
return $title;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Returns a tag in the head.
[46] Fix | Delete
*
[47] Fix | Delete
* @return string The tag.
[48] Fix | Delete
*/
[49] Fix | Delete
public function present() {
[50] Fix | Delete
$value = $this->get();
[51] Fix | Delete
[52] Fix | Delete
if ( \is_string( $value ) && $value !== '' ) {
[53] Fix | Delete
return \sprintf( $this->tag_format, $this->escape_value( $value ) );
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
return '';
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Returns the presentation title.
[61] Fix | Delete
*
[62] Fix | Delete
* @return string The title.
[63] Fix | Delete
*/
[64] Fix | Delete
public function get_title() {
[65] Fix | Delete
$title = $this->replace_vars( $this->presentation->title );
[66] Fix | Delete
[67] Fix | Delete
/**
[68] Fix | Delete
* Filter: 'wpseo_title' - Allow changing the Yoast SEO generated title.
[69] Fix | Delete
*
[70] Fix | Delete
* @param string $title The title.
[71] Fix | Delete
* @param Indexable_Presentation $presentation The presentation of an indexable.
[72] Fix | Delete
*/
[73] Fix | Delete
$title = \apply_filters( 'wpseo_title', $title, $this->presentation );
[74] Fix | Delete
$title = $this->helpers->string->strip_all_tags( $title );
[75] Fix | Delete
return \trim( $title );
[76] Fix | Delete
}
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function