| 1 |
<?php |
| 2 |
|
| 3 |
use WBCR\Factory_Adverts_159\Base; |
| 4 |
|
| 5 |
/** |
| 6 |
* Factory Adverts |
| 7 |
* |
| 8 |
* @author Alexander Vitkalov <[email protected]> |
| 9 |
* @author Alexander Kovalev <[email protected]>, Github: https://github.com/alexkovalevv |
| 10 |
* @since 1.0.0 |
| 11 |
* |
| 12 |
* @package factory-ad-inserter |
| 13 |
* @copyright (c) 2019, Webcraftic Ltd |
| 14 |
* |
| 15 |
* @version 1.3.9 |
| 16 |
*/ |
| 17 |
|
| 18 |
// Exit if accessed directly |
| 19 |
if ( ! defined( 'ABSPATH' ) ) { |
| 20 |
exit; |
| 21 |
} |
| 22 |
|
| 23 |
if ( defined( 'FACTORY_ADVERTS_159_LOADED' ) || ( defined( 'FACTORY_ADVERTS_BLOCK' ) && FACTORY_ADVERTS_BLOCK ) ) { |
| 24 |
return; |
| 25 |
} |
| 26 |
|
| 27 |
# Устанавливаем константу, что модуль уже загружен |
| 28 |
define( 'FACTORY_ADVERTS_159_LOADED', true ); |
| 29 |
|
| 30 |
# Устанавливаем версию модуля |
| 31 |
define( 'FACTORY_ADVERTS_159_VERSION', '1.5.9' ); |
| 32 |
|
| 33 |
add_action( 'init', function () { |
| 34 |
# Регистрируем тектовый домен, для интернализации интерфейса модуля |
| 35 |
load_plugin_textdomain( 'wbcr_factory_adverts_159', false, dirname( plugin_basename( __FILE__ ) ) . '/langs' ); |
| 36 |
} ); |
| 37 |
|
| 38 |
# Устанавливаем директорию модуля |
| 39 |
define( 'FACTORY_ADVERTS_159_DIR', dirname( __FILE__ ) ); |
| 40 |
|
| 41 |
# Устанавливаем url модуля |
| 42 |
define( 'FACTORY_ADVERTS_159_URL', plugins_url( '', __FILE__ ) ); |
| 43 |
|
| 44 |
require_once( FACTORY_ADVERTS_159_DIR . '/includes/class-rest-request.php' ); |
| 45 |
require_once( FACTORY_ADVERTS_159_DIR . '/includes/class-base.php' ); |
| 46 |
|
| 47 |
/** |
| 48 |
* @param Wbcr_Factory480_Plugin $plugin |
| 49 |
*/ |
| 50 |
add_action( 'wbcr_factory_adverts_159_plugin_created', function ( $plugin ) { |
| 51 |
$plugin->set_adverts_manager( "WBCR\Factory_Adverts_159\Base" ); |
| 52 |
} ); |
| 53 |
|