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.../watchers
File: indexable-author-archive-watcher.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Integrations\Watchers;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\SEO\Conditionals\Migrations_Conditional;
[4] Fix | Delete
use Yoast\WP\SEO\Integrations\Cleanup_Integration;
[5] Fix | Delete
use Yoast\WP\SEO\Integrations\Integration_Interface;
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Watches the `wpseo_titles` option for changes to the author archive settings.
[9] Fix | Delete
*/
[10] Fix | Delete
class Indexable_Author_Archive_Watcher implements Integration_Interface {
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Check if the author archives are disabled whenever the `wpseo_titles` option
[14] Fix | Delete
* changes.
[15] Fix | Delete
*
[16] Fix | Delete
* @return void
[17] Fix | Delete
*/
[18] Fix | Delete
public function register_hooks() {
[19] Fix | Delete
\add_action(
[20] Fix | Delete
'update_option_wpseo_titles',
[21] Fix | Delete
[ $this, 'reschedule_indexable_cleanup_when_author_archives_are_disabled' ],
[22] Fix | Delete
10,
[23] Fix | Delete
2
[24] Fix | Delete
);
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* This watcher should only be run when the migrations have been run.
[29] Fix | Delete
* (Otherwise there may not be an indexable table to clean).
[30] Fix | Delete
*
[31] Fix | Delete
* @return string[] The conditionals.
[32] Fix | Delete
*/
[33] Fix | Delete
public static function get_conditionals() {
[34] Fix | Delete
return [ Migrations_Conditional::class ];
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Reschedule the indexable cleanup routine if the author archives are disabled.
[39] Fix | Delete
* to make sure that all authors are removed from the indexables table.
[40] Fix | Delete
*
[41] Fix | Delete
* When author archives are disabled, they can never be indexed.
[42] Fix | Delete
*
[43] Fix | Delete
* @param array $old_value The old `wpseo_titles` option value.
[44] Fix | Delete
* @param array $new_value The new `wpseo_titles` option value.
[45] Fix | Delete
*
[46] Fix | Delete
* @return void
[47] Fix | Delete
*/
[48] Fix | Delete
public function reschedule_indexable_cleanup_when_author_archives_are_disabled( $old_value, $new_value ) {
[49] Fix | Delete
if ( $old_value['disable-author'] !== true && $new_value['disable-author'] === true ) {
[50] Fix | Delete
$cleanup_not_yet_scheduled = ! \wp_next_scheduled( Cleanup_Integration::START_HOOK );
[51] Fix | Delete
if ( $cleanup_not_yet_scheduled ) {
[52] Fix | Delete
\wp_schedule_single_event( ( \time() + ( \MINUTE_IN_SECONDS * 5 ) ), Cleanup_Integration::START_HOOK );
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function