| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Image Hub |
| 4 |
* Plugin URI: https://wpimagehub.com |
| 5 |
* Description: Access and manage royalty-free images from Unsplash, Pixabay, Pexels, Openverse & Giphy without leaving your WordPress dashboard. |
| 6 |
* Version: 1.2.0 |
| 7 |
* Author: ExtendThemes |
| 8 |
* Author URI: https://extendthemes.com |
| 9 |
* Text Domain: image-hub |
| 10 |
* License: GPL-3.0+ |
| 11 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt |
| 12 |
* Requires PHP: 7.4 |
| 13 |
* Requires at least: 6.5 |
| 14 |
*/ |
| 15 |
|
| 16 |
if (! defined('ABSPATH')) { |
| 17 |
exit; // Exit if accessed directly |
| 18 |
} |
| 19 |
|
| 20 |
|
| 21 |
define('IMAGE_HUB_ENTRY_FILE', __FILE__ ); |
| 22 |
define('IMAGE_HUB_ROOT_DIR', plugin_dir_path( __FILE__ ) ); |
| 23 |
define('IMAGE_HUB_ROOT_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) ); |
| 24 |
define("IMAGE_HUB_SERVICE_URL", "https://api.wpimagehub.com"); |
| 25 |
define("IMAGE_HUB_VERSION", "1.2.0"); |
| 26 |
define("IMAGE_HUB_BUILD_NUMBER", '20' ); |
| 27 |
define("IMAGE_HUB_PLUGIN_NAME", "Image Hub"); |
| 28 |
|
| 29 |
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
| 30 |
|
| 31 |
use ImageHub\Admin; |
| 32 |
use ImageHub\MediaModal; |
| 33 |
use ImageHub\Settings; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
function image_hub_init() { |
| 38 |
|
| 39 |
global $image_hub; |
| 40 |
if (! isset($image_hub) && is_admin()) { |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
$settings_instance = new Settings(); |
| 45 |
$admin_instance = new Admin($settings_instance->settings); |
| 46 |
$media_instance = new MediaModal($settings_instance->settings); |
| 47 |
$image_hub = array( |
| 48 |
'settings' => $settings_instance, |
| 49 |
'admin' => $admin_instance, |
| 50 |
'media' => $media_instance, |
| 51 |
); |
| 52 |
} |
| 53 |
return $image_hub; |
| 54 |
} |
| 55 |
|
| 56 |
image_hub_init(); |
| 57 |
|