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/wp-conte.../plugins/wordpres.../src/presente.../admin
File: premium-badge-presenter.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Presenters\Admin;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\SEO\Presenters\Abstract_Presenter;
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Represents the presenter class for "Premium" badges.
[7] Fix | Delete
*/
[8] Fix | Delete
class Premium_Badge_Presenter extends Abstract_Presenter {
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Identifier of the badge.
[12] Fix | Delete
*
[13] Fix | Delete
* @var string
[14] Fix | Delete
*/
[15] Fix | Delete
private $id;
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* Optional link of the badge.
[19] Fix | Delete
*
[20] Fix | Delete
* @var string
[21] Fix | Delete
*/
[22] Fix | Delete
private $link;
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Premium_Badge_Presenter constructor.
[26] Fix | Delete
*
[27] Fix | Delete
* @param string $id Id of the badge.
[28] Fix | Delete
* @param string $link Optional link of the badge.
[29] Fix | Delete
*/
[30] Fix | Delete
public function __construct( $id, $link = '' ) {
[31] Fix | Delete
$this->id = $id;
[32] Fix | Delete
$this->link = $link;
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
/**
[36] Fix | Delete
* Presents the Premium Badge. If a link has been passed, the badge is presented with the link.
[37] Fix | Delete
* Otherwise a static badge is presented.
[38] Fix | Delete
*
[39] Fix | Delete
* @return string The styled Premium Badge.
[40] Fix | Delete
*/
[41] Fix | Delete
public function present() {
[42] Fix | Delete
if ( $this->link !== '' ) {
[43] Fix | Delete
return \sprintf(
[44] Fix | Delete
'<a class="yoast-badge yoast-badge__is-link yoast-premium-badge" id="%1$s-premium-badge" href="%2$s">%3$s</a>',
[45] Fix | Delete
\esc_attr( $this->id ),
[46] Fix | Delete
\esc_url( $this->link ),
[47] Fix | Delete
'Premium' // We don't want this string to be translatable.
[48] Fix | Delete
);
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
return \sprintf(
[52] Fix | Delete
'<span class="yoast-badge yoast-premium-badge" id="%1$s-premium-badge">%2$s</span>',
[53] Fix | Delete
\esc_attr( $this->id ),
[54] Fix | Delete
'Premium' // We don't want this string to be translatable.
[55] Fix | Delete
);
[56] Fix | Delete
}
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function