prefix.'a4barcode_custom_templates'; $chosenTemplateRow = $wpdb->get_row("SELECT * FROM `{$table}` WHERE `is_active` = 1"); $chosenTemplateRow->template = str_replace("\n", '', $chosenTemplateRow->template); include_once A4B_PLUGIN_BASE_PATH.'templates/printpage.php'; die(); } /** * Autoloader. */ require_once __DIR__.'/lib/autoload.php'; /** * Define global functions. */ require_once __DIR__.'/class/functions.php'; // if php version is 7.1 and less, set more precision for fractional numbers if (version_compare(phpversion(), '7.1', '>=')) { ini_set('precision', 17); ini_set('serialize_precision', -1); } // Check php version in not lower 5.6.0 if (version_compare(phpversion(), '5.6.0', '<')) { usTriggerError('Barcode Generator - The minimum PHP version required for this plugin is 5.6.0. Please update PHP version.', E_USER_ERROR); } /* * Create tables. */ register_activation_hook(__FILE__, function ($network_wide) { UkrSolution\WpBarcodesGenerator\Database::setupTables($network_wide); }); /* * Creating table whenever a new blog is created. */ function on_create_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) { // If plugin is active for network, create tables for new blog. if (is_plugin_active_for_network('a4-barcode-generator/barcode_generator.php')) { switch_to_blog($blog_id); UkrSolution\WpBarcodesGenerator\Database::createTables(); restore_current_blog(); } } add_action('wpmu_new_blog', 'on_create_blog', 10, 6); /* * Load text domain */ add_action('plugins_loaded', function () { $pluginRelPath = basename(dirname(__FILE__)).'/languages'; load_plugin_textdomain('wpbcu-barcode-generator', false, $pluginRelPath); }); /* * Show notices on the page. */ add_action('admin_notices', function () { a4bShowNotices(); }); /* * Start plugin */ UkrSolution\WpBarcodesGenerator\PostData::setPostData(); $a4bcConfig = require A4B_PLUGIN_BASE_PATH.'config/config.php'; new UkrSolution\WpBarcodesGenerator\Core($a4bcConfig);