PluginProbe
Disable Comments & Delete All Comments / 1.3.0
Disable Comments & Delete All Comments v1.3.0
1.3.3 1.3.2 trunk 1.0.0 1.0.4 1.0.5 1.0.8 1.0.9 1.1.1 1.1.3 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.3.0 1.3.1
comments-plus / clearfy.php

clearfy.php in Disable Comments & Delete All Comments 1.3.0, at clearfy.php

53 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Этот файл инициализирует этот плагин, как аддон для плагина Clearfy.
4 *
5 * Файл будет подключен только в плагине Clearfy, используя особый вариант загрузки. Это более простое решение
6 * пришло на смену встроенной системы подключения аддонов в фреймворке.
7 *
8 * @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
9 * @copyright (c) 2018 Webraftic Ltd
10 */
11
12 // Exit if accessed directly
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 if ( ! defined( 'WCM_PLUGIN_ACTIVE' ) ) {
18 define( 'WCM_PLUGIN_VERSION', '1.2.0' );
19 define( 'WCM_TEXT_DOMAIN', 'comments-plus' );
20 define( 'WCM_PLUGIN_ACTIVE', true );
21
22 // Этот плагин загружен, как аддон для плагина Clearfy
23 define( 'LOADING_COMMENTS_PLUS_AS_ADDON', true );
24
25 if ( ! defined( 'WCM_PLUGIN_DIR' ) ) {
26 define( 'WCM_PLUGIN_DIR', dirname( __FILE__ ) );
27 }
28
29 if ( ! defined( 'WCM_PLUGIN_BASE' ) ) {
30 define( 'WCM_PLUGIN_BASE', plugin_basename( __FILE__ ) );
31 }
32
33 if ( ! defined( 'WCM_PLUGIN_URL' ) ) {
34 define( 'WCM_PLUGIN_URL', plugins_url( '', __FILE__ ) );
35 }
36
37 try {
38 // Global scripts
39 require_once( WCM_PLUGIN_DIR . '/includes/3rd-party/class-clearfy-plugin.php' );
40 new WCM_Plugin();
41 } catch( Exception $e ) {
42 $wcm_plugin_error_func = function () use ( $e ) {
43 $error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Disable Comments', $e->getMessage(), $e->getCode() );
44 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
45 };
46
47 add_action( 'admin_notices', $wcm_plugin_error_func );
48 add_action( 'network_admin_notices', $wcm_plugin_error_func );
49 }
50 }
51
52
53