Yoast\WP\SEO\Bulk_Editor\User_Interface
Bulk_Editor_Integration::get_woo_seo_update_url
Returns where the current user can update Yoast WooCommerce SEO, or an empty string when it needs no update or the user lacks the update_plugins capability.
The one-click update URL when WordPress has a package for a version that fills the tab. Otherwise the Updates screen, which checks for updates again and, on multisite, redirects to the network screen, where plugin updates are listed. Subscriptions are left to Yoast WooCommerce SEO, which handles them once it fills the tab.
Метод класса: Bulk_Editor_Integration{}
Хуков нет.
Возвращает
string. The one-click update or Updates screen URL, or an empty string.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_woo_seo_update_url( $needs_update, $can_update_plugins ): string;
- $needs_update(true|false) (обязательный)
- Whether an active Yoast WooCommerce SEO predates the tab.
- $can_update_plugins(true|false) (обязательный)
- Whether the current user may update plugins.
Код Bulk_Editor_Integration::get_woo_seo_update_url() Bulk Editor Integration::get woo seo update url Yoast 28.9
private function get_woo_seo_update_url( bool $needs_update, bool $can_update_plugins ): string {
if ( ! $needs_update || ! $can_update_plugins ) {
return '';
}
$plugin_file = $this->addon_manager->get_plugin_file( WPSEO_Addon_Manager::WOOCOMMERCE_SLUG );
if ( \is_string( $plugin_file ) && $plugin_file !== '' && $this->has_update_package( $plugin_file ) ) {
return $this->get_plugin_update_url( $plugin_file );
}
return \self_admin_url( 'update-core.php' );
}