generated from devgeniem/tms-plugin-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugin.php
42 lines (36 loc) · 1.21 KB
/
plugin.php
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
39
40
41
42
<?php
/**
* Plugin Name: TMS News Importer
* Plugin URI: https://github.com/devgeniem/tms-plugin-news-importer
* Description: Import news from tampere.fi api.
* Version: 0.3.2
* Requires PHP: 8.1
* Author: Geniem Oy
* Author URI: https://geniem.com
* License: GPL v3 or later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: tms-plugin-news-importer
* Domain Path: /languages
*/
use TMS\Plugin\NewsImporter\NewsImporterPlugin;
// Check if Composer has been initialized in this directory.
// Otherwise we just use global composer autoloading.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
// Get the plugin version.
$plugin_data = get_file_data( __FILE__, [ 'Version' => 'Version' ], 'plugin' );
$plugin_version = $plugin_data['Version'];
$plugin_path = __DIR__;
// Initialize the plugin.
NewsImporterPlugin::init( $plugin_version, $plugin_path );
if ( ! function_exists( 'tms_plugin_news_importer' ) ) {
/**
* Get the tms-plugin-news-importer plugin instance.
*
* @return NewsImporterPlugin
*/
function tms_plugin_news_importer() : NewsImporterPlugin {
return NewsImporterPlugin::plugin();
}
}