PluginNotice.php
1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
declare( strict_types=1 );
namespace ACP\Service;
use AC\IntegrationRepository;
use AC\Message;
use AC\Registerable;
use AC\Type\Url\Documentation;
class PluginNotice implements Registerable {
/**
* @var IntegrationRepository
*/
private $integration_repository;
public function __construct( IntegrationRepository $integration_repository ) {
$this->integration_repository = $integration_repository;
}
public function register() {
$integrations = $this->integration_repository->find_all();
$message = sprintf( __( 'This integration add-on is no longer required by %s and can be safely removed.', 'codepress-admin-columns' ), 'Admin Columns Pro' );
$message .= sprintf( ' <a target="_blank" href="%s">%s</a>', Documentation::create_with_path( Documentation::ARTICLE_RELEASE_6 ), 'Learn more »' );
foreach ( $integrations as $integration ) {
$notice = new Message\Plugin(
$message,
$integration->get_basename(),
Message::INFO
);
$notice->register();
}
}
}