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/integrat.../admin
File: fix-news-dependencies-integration.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Integrations\Admin;
[2] Fix | Delete
[3] Fix | Delete
use WP_Screen;
[4] Fix | Delete
use WPSEO_Admin_Asset_Manager;
[5] Fix | Delete
use Yoast\WP\SEO\Conditionals\Admin_Conditional;
[6] Fix | Delete
use Yoast\WP\SEO\Conditionals\News_Conditional;
[7] Fix | Delete
use Yoast\WP\SEO\Integrations\Integration_Interface;
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* Fix_News_Dependencies_Integration class.
[11] Fix | Delete
*/
[12] Fix | Delete
class Fix_News_Dependencies_Integration implements Integration_Interface {
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* Returns the conditionals based in which this loadable should be active.
[16] Fix | Delete
*
[17] Fix | Delete
* In this case: when on an admin page.
[18] Fix | Delete
*
[19] Fix | Delete
* @return array The conditionals.
[20] Fix | Delete
*/
[21] Fix | Delete
public static function get_conditionals() {
[22] Fix | Delete
return [ Admin_Conditional::class, News_Conditional::class ];
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* Registers an action to disable script concatenation.
[27] Fix | Delete
*
[28] Fix | Delete
* @return void
[29] Fix | Delete
*/
[30] Fix | Delete
public function register_hooks() {
[31] Fix | Delete
global $pagenow;
[32] Fix | Delete
[33] Fix | Delete
// Load the editor script when on an edit post or new post page.
[34] Fix | Delete
$is_post_edit_page = $pagenow === 'post.php' || $pagenow === 'post-new.php';
[35] Fix | Delete
if ( $is_post_edit_page ) {
[36] Fix | Delete
\add_action( 'admin_enqueue_scripts', [ $this, 'add_news_script_dependency' ], 11 );
[37] Fix | Delete
}
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
/**
[41] Fix | Delete
* Fixes the news script dependency.
[42] Fix | Delete
*
[43] Fix | Delete
* @return void
[44] Fix | Delete
*/
[45] Fix | Delete
public function add_news_script_dependency() {
[46] Fix | Delete
$scripts = \wp_scripts();
[47] Fix | Delete
[48] Fix | Delete
if ( ! isset( $scripts->registered['wpseo-news-editor'] ) ) {
[49] Fix | Delete
return;
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
$is_block_editor = WP_Screen::get()->is_block_editor();
[53] Fix | Delete
$post_edit_handle = 'post-edit';
[54] Fix | Delete
if ( ! $is_block_editor ) {
[55] Fix | Delete
$post_edit_handle = 'post-edit-classic';
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
$scripts->registered['wpseo-news-editor']->deps[] = WPSEO_Admin_Asset_Manager::PREFIX . $post_edit_handle;
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function