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...
File: schema-presenter.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Presenters;
[2] Fix | Delete
[3] Fix | Delete
use WPSEO_Utils;
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Presenter class for the schema object.
[7] Fix | Delete
*/
[8] Fix | Delete
class Schema_Presenter extends Abstract_Indexable_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 = 'schema';
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* Returns the schema output.
[19] Fix | Delete
*
[20] Fix | Delete
* @return string The schema tag.
[21] Fix | Delete
*/
[22] Fix | Delete
public function present() {
[23] Fix | Delete
$deprecated_data = [
[24] Fix | Delete
'_deprecated' => 'Please use the "wpseo_schema_*" filters to extend the Yoast SEO schema data - see the WPSEO_Schema class.',
[25] Fix | Delete
];
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* Filter: 'wpseo_json_ld_output' - Allows disabling Yoast's schema output entirely.
[29] Fix | Delete
*
[30] Fix | Delete
* @param mixed $deprecated If false or an empty array is returned, disable our output.
[31] Fix | Delete
* @param string $empty
[32] Fix | Delete
*/
[33] Fix | Delete
$return = \apply_filters( 'wpseo_json_ld_output', $deprecated_data, '' );
[34] Fix | Delete
if ( $return === [] || $return === false ) {
[35] Fix | Delete
return '';
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
/**
[39] Fix | Delete
* Action: 'wpseo_json_ld' - Output Schema before the main schema from Yoast SEO is output.
[40] Fix | Delete
*/
[41] Fix | Delete
\do_action( 'wpseo_json_ld' );
[42] Fix | Delete
[43] Fix | Delete
$schema = $this->get();
[44] Fix | Delete
if ( \is_array( $schema ) ) {
[45] Fix | Delete
$output = WPSEO_Utils::format_json_encode( $schema );
[46] Fix | Delete
$output = \str_replace( "\n", \PHP_EOL . "\t", $output );
[47] Fix | Delete
return '<script type="application/ld+json" class="yoast-schema-graph">' . $output . '</script>';
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
return '';
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
/**
[54] Fix | Delete
* Gets the raw value of a presentation.
[55] Fix | Delete
*
[56] Fix | Delete
* @return array The raw value.
[57] Fix | Delete
*/
[58] Fix | Delete
public function get() {
[59] Fix | Delete
return $this->presentation->schema;
[60] Fix | Delete
}
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function