| 345 | | $link = network_admin_url( 'plugin-install.php?tab=search&s=Link+Manager' ); |
| 346 | | /* translators: %s: URL to install the Link Manager plugin. */ |
| 347 | | wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) ); |
| | 345 | |
| | 346 | require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; |
| | 347 | |
| | 348 | $link_manager_plugin = plugins_api( 'plugin_information', [ 'slug' => 'link-manager' ] ); |
| | 349 | $plugin_status = install_plugin_install_status( $link_manager_plugin ); |
| | 350 | |
| | 351 | if ( 'install' === $plugin_status['status'] ) { |
| | 352 | $link = $plugin_status['url']; |
| | 353 | |
| | 354 | /* translators: %s: URL to install the Link Manager plugin. */ |
| | 355 | wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) ); |
| | 356 | } |
| | 357 | |
| | 358 | if ( 'latest_installed' === $plugin_status['status'] && ! is_plugin_active( $plugin_status['file'] ) ) { |
| | 359 | $link = add_query_arg( |
| | 360 | array( |
| | 361 | '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin_status['file'] ), |
| | 362 | 'action' => 'activate', |
| | 363 | 'plugin' => $plugin_status['file'], |
| | 364 | ), |
| | 365 | network_admin_url( 'plugins.php' ) |
| | 366 | ); |
| | 367 | |
| | 368 | /* translators: %s: URL to activate the Link Manager plugin. */ |
| | 369 | wp_die( sprintf( __( 'If you are looking to use the link manager, please activate the <a href="%s">Link Manager</a> plugin.' ), $link ) ); |
| | 370 | } |
| | 371 | |