Пример #1
0
require_once CYCLONE_PATH . 'classes/class-image-resizer.php';
require_once CYCLONE_PATH . 'classes/class-nextgen-integration.php';
require_once CYCLONE_PATH . 'inc/functions.php';
$cyclone_slider_saved_done = false;
//Global variable to limit save_post execution to only once
// Store the plugin instance to a global object so that other plugins can use remove_action and remove_filter
// Inject dependencies here
$codefleet_view = new Codefleet_View();
$cyclone_slider_image_resizer = new Cyclone_Slider_Image_Resizer();
$cyclone_slider_data = new Cyclone_Slider_Data($cyclone_slider_image_resizer);
$cyclone_slider_nextgen_integration = new Nextgen_Integration($cyclone_slider_data);
$cyclone_slider_exporter = new Cyclone_Slider_Exporter($cyclone_slider_data);
$cyclone_slider_importer = new Cyclone_Slider_Importer($cyclone_slider_data);
$cyclone_slider_templates_manager = new Cyclone_Templates_Manager();
// Add directories to get templates
$cyclone_slider_templates_manager->add_template_location(array('path' => CYCLONE_PATH . 'templates' . DIRECTORY_SEPARATOR, 'url' => CYCLONE_URL . 'templates/', 'location_name' => 'core'));
$cyclone_slider_templates_manager->add_template_location(array('path' => realpath(get_stylesheet_directory()) . DIRECTORY_SEPARATOR . 'cycloneslider' . DIRECTORY_SEPARATOR, 'url' => get_stylesheet_directory_uri() . "/cycloneslider/", 'location_name' => 'active-theme'));
$cyclone_upload_dir = wp_upload_dir();
$cyclone_template_folder = realpath(dirname($cyclone_upload_dir['basedir']));
$cyclone_slider_templates_manager->add_template_location(array('path' => $cyclone_template_folder . DIRECTORY_SEPARATOR . 'cycloneslider' . DIRECTORY_SEPARATOR, 'url' => content_url() . "/cycloneslider/", 'location_name' => 'wp-content'));
$cyclone_slider_settings_page = new Cyclone_Slider_Settings_Page($codefleet_view, $cyclone_slider_templates_manager);
$cyclone_slider_settings_page->set_option_group('cyclone_option_group');
$cyclone_slider_settings_page->set_option_name('cyclone_option_name');
$cyclone_slider_settings_page->set_parent_slug('edit.php?post_type=cycloneslider');
$cyclone_slider_settings_page->set_menu_slug('cycloneslider-settings');
$cyclone_slider_youtube = new Cyclone_Slider_Youtube();
$cyclone_slider_vimeo = new Cyclone_Slider_Vimeo();
$cyclone_slider_scripts = new Cyclone_Slider_Scripts($cyclone_slider_templates_manager, $cyclone_slider_settings_page->get_settings_data());
$cyclone_slider_admin = new Cyclone_Slider_Admin($codefleet_view, $cyclone_slider_scripts, $cyclone_slider_templates_manager, $cyclone_slider_data, $cyclone_slider_settings_page->get_settings_data());
$cyclone_slider_plugin_instance = new Cyclone_Slider($cyclone_slider_scripts, $cyclone_slider_data, $codefleet_view, $cyclone_slider_templates_manager, $cyclone_slider_youtube, $cyclone_slider_vimeo);
// Load domain in this hook to work with WPML
Пример #2
0
require_once CYCLONE_PATH . 'classes/class-image-resizer.php';
require_once CYCLONE_PATH . 'classes/class-nextgen-integration.php';
require_once CYCLONE_PATH . 'inc/functions.php';
$cyclone_slider_saved_done = false;
//Global variable to limit save_post execution to only once
// Store the plugin instance to a global object so that other plugins can use remove_action and remove_filter
// Inject dependencies here
$codefleet_view = new Codefleet_View();
$cyclone_slider_image_resizer = new Cyclone_Slider_Image_Resizer();
$cyclone_slider_data = new Cyclone_Slider_Data($cyclone_slider_image_resizer);
$cyclone_slider_nextgen_integration = new Nextgen_Integration($cyclone_slider_data);
$cyclone_slider_exporter = new Cyclone_Slider_Exporter($cyclone_slider_data);
$cyclone_slider_importer = new Cyclone_Slider_Importer($cyclone_slider_data);
$cyclone_slider_templates_manager = new Cyclone_Templates_Manager();
// Add directories to get templates
$cyclone_slider_templates_manager->add_template_location(array('path' => CYCLONE_PATH . 'templates/', 'url' => CYCLONE_URL . 'templates/'));
$cyclone_slider_templates_manager->add_template_location(array('path' => realpath(get_stylesheet_directory()) . DIRECTORY_SEPARATOR . 'cycloneslider' . DIRECTORY_SEPARATOR, 'url' => get_stylesheet_directory_uri() . "/cycloneslider/"));
$cyclone_slider_settings_page = new Cyclone_Slider_Settings_Page($codefleet_view, $cyclone_slider_templates_manager);
$cyclone_slider_settings_page->set_option_group('cyclone_option_group');
$cyclone_slider_settings_page->set_option_name('cyclone_option_name');
$cyclone_slider_settings_page->set_parent_slug('edit.php?post_type=cycloneslider');
$cyclone_slider_settings_page->set_menu_slug('cycloneslider-settings');
$cyclone_slider_youtube = new Cyclone_Slider_Youtube();
$cyclone_slider_vimeo = new Cyclone_Slider_Vimeo();
$cyclone_slider_scripts = new Cyclone_Slider_Scripts($cyclone_slider_templates_manager, $cyclone_slider_settings_page->get_settings_data());
$cyclone_slider_admin = new Cyclone_Slider_Admin($codefleet_view, $cyclone_slider_scripts, $cyclone_slider_templates_manager, $cyclone_slider_data, $cyclone_slider_settings_page->get_settings_data());
$cyclone_slider_plugin_instance = new Cyclone_Slider($cyclone_slider_scripts, $cyclone_slider_data, $codefleet_view, $cyclone_slider_templates_manager, $cyclone_slider_youtube, $cyclone_slider_vimeo);
// Load domain in this hook to work with WPML
add_action('plugins_loaded', 'cycloneslider_plugin_init');
function cycloneslider_plugin_init()
{