Yoast\WP\SEO\Integrations\Watchers
Addon_Update_Watcher::replace_auto_update_toggles_of_addons() public Yoast 1.0
Replaces the auto-update toggle links for the Yoast add-ons with a text explaining that toggling the Yoast SEO auto-update setting automatically toggles the one for the setting for the add-ons as well.
{} Это метод класса: Addon_Update_Watcher{}
Хуков нет.
Возвращает
Строку
. The new HTML, with the auto-update toggle link replaced.
Использование
$Addon_Update_Watcher = new Addon_Update_Watcher(); $Addon_Update_Watcher->replace_auto_update_toggles_of_addons( $old_html, $plugin );
- $old_html(строка) (обязательный)
- The old HTML.
- $plugin(строка) (обязательный)
- The plugin.
Код Addon_Update_Watcher::replace_auto_update_toggles_of_addons() Addon Update Watcher::replace auto update toggles of addons Yoast 16.1.1
public function replace_auto_update_toggles_of_addons( $old_html, $plugin ) {
if ( ! \is_string( $old_html ) ) {
return $old_html;
}
$not_a_yoast_addon = ! \in_array( $plugin, self::ADD_ONS, true );
if ( $not_a_yoast_addon ) {
return $old_html;
}
$auto_updated_plugins = \get_site_option( 'auto_update_plugins' );
if ( $this->are_auto_updates_enabled( self::WPSEO_FREE_PLUGIN_ID, $auto_updated_plugins ) ) {
return \sprintf(
'<em>%s</em>',
\sprintf(
/* Translators: %1$s resolves to Yoast SEO. */
\esc_html__( 'Auto-updates are enabled based on this setting for %1$s.', 'wordpress-seo' ),
'Yoast SEO'
)
);
}
return \sprintf(
'<em>%s</em>',
\sprintf(
/* Translators: %1$s resolves to Yoast SEO. */
\esc_html__( 'Auto-updates are disabled based on this setting for %1$s.', 'wordpress-seo' ),
'Yoast SEO'
)
);
}