-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
executable file
·35 lines (29 loc) · 958 Bytes
/
bootstrap.php
File metadata and controls
executable file
·35 lines (29 loc) · 958 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
<?php
/**
* Plugin Name: News Data IO
* Description: Query newsdata.io for latest news.
* Version: 1.0.0
* Requires at least: 5.3
* Requires PHP: 7.4
* Tested up to: 6.6.1
* Author: Cyclonecode
* Author URI: https://stackoverflow.com/users/1047662/cyclonecode?tab=profile
* Copyright: Cyclonecode
* License: GPLv2 or later
* Text Domain: newsdata-io
* Domain Path: /languages
*
* @author Cyclonecode
*/
namespace Cyclonecode\NewsDataIO;
require_once __DIR__ . '/vendor/autoload.php';
use Cyclonecode\NewsDataIO\Adapters\LatestNewsAdapter;
use Cyclonecode\NewsDataIO\Plugin\Settings\Settings;
add_action('plugins_loaded', function () {
$client = new \GuzzleHttp\Client();
$settings = new Settings(NewsDataIO::OPTION_NAME);
$io = new NewsDataIO($settings);
$adapter = new LatestNewsAdapter($settings, $client);
$io->setAdapter($adapter);
}, 10, 0);
register_uninstall_hook(__FILE__, NewsDataIO::class . '::uninstall');