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/integrat.../third-pa...
File: woocommerce-post-edit.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Integrations\Third_Party;
[2] Fix | Delete
[3] Fix | Delete
use WP_Post;
[4] Fix | Delete
use Yoast\WP\SEO\Conditionals\Admin\Post_Conditional;
[5] Fix | Delete
use Yoast\WP\SEO\Conditionals\WooCommerce_Conditional;
[6] Fix | Delete
use Yoast\WP\SEO\Integrations\Integration_Interface;
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* A WooCommerce integration that runs in the post editor.
[10] Fix | Delete
*/
[11] Fix | Delete
class WooCommerce_Post_Edit implements Integration_Interface {
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Register the hooks for this integration to work.
[15] Fix | Delete
*
[16] Fix | Delete
* @return void
[17] Fix | Delete
*/
[18] Fix | Delete
public function register_hooks() {
[19] Fix | Delete
\add_filter( 'wpseo_post_edit_values', [ $this, 'remove_meta_description_date' ], 10, 2 );
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* Only run this integration when WooCommerce is active and the user is in the post editor.
[24] Fix | Delete
*
[25] Fix | Delete
* @return string[] The conditionals that should be met before this integration is loaded.
[26] Fix | Delete
*/
[27] Fix | Delete
public static function get_conditionals() {
[28] Fix | Delete
return [ WooCommerce_Conditional::class, Post_Conditional::class ];
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
/**
[32] Fix | Delete
* Don't show the date in the Google preview for WooCommerce products,
[33] Fix | Delete
* since Google does not show dates for product pages in the search results.
[34] Fix | Delete
*
[35] Fix | Delete
* @param array $values Key-value map of variables we enqueue in the JavaScript of the post editor.
[36] Fix | Delete
* @param WP_Post $post The post currently opened in the editor.
[37] Fix | Delete
*
[38] Fix | Delete
* @return array The values, where the `metaDescriptionDate` is set to the empty string.
[39] Fix | Delete
*/
[40] Fix | Delete
public function remove_meta_description_date( $values, $post ) {
[41] Fix | Delete
if ( $post->post_type === 'product' ) {
[42] Fix | Delete
$values['metaDescriptionDate'] = '';
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
return $values;
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function