forked from mcguffin/polylang-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
68 lines (51 loc) · 2.09 KB
/
index.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
61
62
63
64
65
66
67
68
<?php
/*
Plugin Name: Polylang Sync
Plugin URI: https://github.com/mcguffin/polylang-sync
Description: Keep Menus, ACF-Fields and more in Sync on your Polylang-Powered multilingual WordPress-Site.
Author: Jörn Lund
Version: 0.0.14
Author URI: https://github.com/mcguffin/
License: GPL3
Github Repository: mcguffin/polylang-sync
Github Plugin URI: mcguffin/polylang-sync
Text Domain: polylang-sync
Domain Path: /languages/
*/
/* Copyright 2017 Jörn Lund
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
Plugin was generated by WP Plugin Scaffold
https://github.com/mcguffin/wp-plugin-scaffold
Command line args were: `"ACF Polylang Sync" admin+css+js settings_page+css+js git`
*/
namespace PolylangSync;
if ( ! defined('ABSPATH') ) {
die('FU!');
}
require_once __DIR__ . DIRECTORY_SEPARATOR . 'include/autoload.php';
Core\Core::instance( __FILE__ );
if ( is_admin() || defined( 'DOING_AJAX' ) ) {
// don't WP-Update actual repos!
if ( ! file_exists( plugin_dir_path(__FILE__) . '/.git/' ) ) {
// not a git. Check if https://github.com/afragen/github-updater is active. (function is_plugin_active not available yet)
$active_plugins = get_option('active_plugins');
if ( $sitewide_plugins = get_site_option('active_sitewide_plugins') ) {
$active_plugins = array_merge( $active_plugins, array_keys( $sitewide_plugins ) );
}
if ( ! in_array( 'github-updater/github-updater.php', $active_plugins ) ) {
// not github updater. Init our our own...
AutoUpdate\AutoUpdateGithub::instance();
}
}
}