-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmittnett-relume.php
60 lines (54 loc) · 1.33 KB
/
mittnett-relume.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* Plugin Name: Mittnett Relume Sitemap Importer
* Description: A plugin to import CSV files and generate pages and sections from Relume.io exports.
* Version: 1.0.0
* Author: Bjørn Kristiansen - Mittnett
* Author URI: https://mittnett.no
* Text Domain: mittnett-relume
*
* @package MittnettRelume
*/
defined( 'ABSPATH' ) || exit;
/**
* Log a message to the error log.
*
* @param mixed $log The message to log.
* @param string $message Optional. A message to prepend to the log.
* @return void
*/
function wplog( $log, $message = '' ) {
if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
return;
}
// Prepare the log message based on the type of $log.
if ( is_null( $log ) ) {
$log = 'null';
}
if ( false === $log ) {
$log = 'false';
}
if ( true === $log ) {
$log = 'true';
}
// Log arrays or objects with print_r; simple text otherwise.
if ( is_array( $log ) || is_object( $log ) ) {
if ( ! empty( $message ) ) {
error_log( $message );
}
error_log( print_r( $log, true ) );
} else {
error_log( $message . $log );
}
}
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
use Mittnett\Relume\Admin\Admin;
/**
* Initialize the plugin.
*/
function mittnett_relume_init() {
new Admin();
}
add_action( 'plugins_loaded', 'mittnett_relume_init' );