parsers
9 months ago
admin.php
7 months ago
core.php
6 months ago
engine.php
6 months ago
init.php
7 months ago
parsers.php
10 months ago
rest.php
6 months ago
support.php
6 months ago
ui.php
3 years ago
init.php
42 lines
| 1 | <?php |
| 2 | |
| 3 | if ( class_exists( 'MeowPro_WPMC_Core' ) && class_exists( 'Meow_WPMC_Core' ) ) { |
| 4 | function wpmc_thanks_admin_notices() { |
| 5 | echo '<div class="error"><p>' . __( 'Thanks for installing the Pro version of Media Cleaner :) However, the free version is still enabled. Please disable or uninstall it.', 'media-cleaner' ) . '</p></div>'; |
| 6 | } |
| 7 | add_action( 'admin_notices', 'wpmc_thanks_admin_notices' ); |
| 8 | return; |
| 9 | } |
| 10 | |
| 11 | spl_autoload_register(function ( $class ) { |
| 12 | $necessary = true; |
| 13 | $file = null; |
| 14 | if ( strpos( $class, 'Meow_WPMC' ) !== false ) { |
| 15 | $file = WPMC_PATH . '/classes/' . str_replace( 'meow_wpmc_', '', strtolower( $class ) ) . '.php'; |
| 16 | } |
| 17 | else if ( strpos( $class, 'MeowKit_WPMC_' ) !== false ) { |
| 18 | $file = WPMC_PATH . '/common/' . str_replace( 'meowkit_wpmc_', '', strtolower( $class ) ) . '.php'; |
| 19 | } |
| 20 | else if ( strpos( $class, 'MeowKitPro_WPMC_' ) !== false ) { |
| 21 | $necessary = false; |
| 22 | $file = WPMC_PATH . '/common/premium/' . str_replace( 'meowkitpro_wpmc_', '', strtolower( $class ) ) . '.php'; |
| 23 | } |
| 24 | else if ( strpos( $class, 'MeowPro_WPMC' ) !== false ) { |
| 25 | $necessary = false; |
| 26 | $file = WPMC_PATH . '/premium/' . str_replace( 'meowpro_wpmc_', '', strtolower( $class ) ) . '.php'; |
| 27 | } |
| 28 | if ( $file ) { |
| 29 | if ( !$necessary && !file_exists( $file ) ) { |
| 30 | return; |
| 31 | } |
| 32 | require( $file ); |
| 33 | } |
| 34 | }); |
| 35 | |
| 36 | // In admin or Rest API request (REQUEST URI begins with '/wp-json/') |
| 37 | if ( is_admin() || MeowKit_WPMC_Helpers::is_rest() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
| 38 | global $wpmc_core; |
| 39 | $wpmc_core = new Meow_WPMC_Core(); |
| 40 | } |
| 41 | |
| 42 | ?> |