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.../public_h.../wp-conte.../plugins/wordpres.../src/generato.../schema
File: website.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Generators\Schema;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\SEO\Config\Schema_IDs;
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Returns schema Website data.
[7] Fix | Delete
*/
[8] Fix | Delete
class Website extends Abstract_Schema_Piece {
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Determines whether or not a piece should be added to the graph.
[12] Fix | Delete
*
[13] Fix | Delete
* @return bool
[14] Fix | Delete
*/
[15] Fix | Delete
public function is_needed() {
[16] Fix | Delete
return true;
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* Outputs code to allow recognition of the internal search engine.
[21] Fix | Delete
*
[22] Fix | Delete
* @return array Website data blob.
[23] Fix | Delete
*/
[24] Fix | Delete
public function generate() {
[25] Fix | Delete
$data = [
[26] Fix | Delete
'@type' => 'WebSite',
[27] Fix | Delete
'@id' => $this->context->site_url . Schema_IDs::WEBSITE_HASH,
[28] Fix | Delete
'url' => $this->context->site_url,
[29] Fix | Delete
'name' => $this->helpers->schema->html->smart_strip_tags( $this->context->site_name ),
[30] Fix | Delete
'description' => \get_bloginfo( 'description' ),
[31] Fix | Delete
];
[32] Fix | Delete
[33] Fix | Delete
if ( $this->context->site_represents_reference ) {
[34] Fix | Delete
$data['publisher'] = $this->context->site_represents_reference;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
$data = $this->add_alternate_name( $data );
[38] Fix | Delete
$data = $this->internal_search_section( $data );
[39] Fix | Delete
$data = $this->helpers->schema->language->add_piece_language( $data );
[40] Fix | Delete
[41] Fix | Delete
return $data;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Returns an alternate name if one was specified in the Yoast SEO settings.
[46] Fix | Delete
*
[47] Fix | Delete
* @param array $data The website data array.
[48] Fix | Delete
*
[49] Fix | Delete
* @return array
[50] Fix | Delete
*/
[51] Fix | Delete
private function add_alternate_name( $data ) {
[52] Fix | Delete
if ( $this->context->alternate_site_name !== '' ) {
[53] Fix | Delete
$data['alternateName'] = $this->helpers->schema->html->smart_strip_tags( $this->context->alternate_site_name );
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
return $data;
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Adds the internal search JSON LD code to the homepage if it's not disabled.
[61] Fix | Delete
*
[62] Fix | Delete
* @link https://developers.google.com/search/docs/data-types/sitelinks-searchbox
[63] Fix | Delete
*
[64] Fix | Delete
* @param array $data The website data array.
[65] Fix | Delete
*
[66] Fix | Delete
* @return array
[67] Fix | Delete
*/
[68] Fix | Delete
private function internal_search_section( $data ) {
[69] Fix | Delete
/**
[70] Fix | Delete
* Filter: 'disable_wpseo_json_ld_search' - Allow disabling of the json+ld output.
[71] Fix | Delete
*
[72] Fix | Delete
* @param bool $display_search Whether or not to display json+ld search on the frontend.
[73] Fix | Delete
*/
[74] Fix | Delete
if ( \apply_filters( 'disable_wpseo_json_ld_search', false ) ) {
[75] Fix | Delete
return $data;
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
/**
[79] Fix | Delete
* Filter: 'wpseo_json_ld_search_url' - Allows filtering of the search URL for Yoast SEO.
[80] Fix | Delete
*
[81] Fix | Delete
* @param string $search_url The search URL for this site with a `{search_term_string}` variable.
[82] Fix | Delete
*/
[83] Fix | Delete
$search_url = \apply_filters( 'wpseo_json_ld_search_url', $this->context->site_url . '?s={search_term_string}' );
[84] Fix | Delete
[85] Fix | Delete
$data['potentialAction'][] = [
[86] Fix | Delete
'@type' => 'SearchAction',
[87] Fix | Delete
'target' => [
[88] Fix | Delete
'@type' => 'EntryPoint',
[89] Fix | Delete
'urlTemplate' => $search_url,
[90] Fix | Delete
],
[91] Fix | Delete
'query-input' => 'required name=search_term_string',
[92] Fix | Delete
];
[93] Fix | Delete
[94] Fix | Delete
return $data;
[95] Fix | Delete
}
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function