コード例 #1
0
ファイル: wpshop.php プロジェクト: pronoSoupe/pronobo_soupe
/*	Include the config file	*/
require WP_PLUGIN_DIR . '/' . WPSHOP_PLUGIN_DIR . '/includes/config.php';
/*
 * Allow to get errors back when debug mode is set to true
 */
if (WPSHOP_DEBUG_MODE && (in_array(long2ip(ip2long($_SERVER['REMOTE_ADDR'])), unserialize(WPSHOP_DEBUG_MODE_ALLOWED_IP)) || !empty($_GET['distant_debug_mode']) && $_GET['distant_debug_mode'] == 'eoxia')) {
    ini_set('display_errors', true);
    error_reporting(E_ALL);
}
include_once WPSHOP_LIBRAIRIES_DIR . 'init.class.php';
/*	Call main initialisation function	*/
add_action('init', array('wpshop_init', 'load'));
/*	Include the main including file	*/
require WP_PLUGIN_DIR . '/' . WPSHOP_PLUGIN_DIR . '/includes/include.php';
/*	Check and set (if needed) administrator(s) permissions' each time the plugin is launched. Admin role has all right	*/
wpshop_permissions::set_administrator_role_permission();
wpshop_permissions::wpshop_init_roles();
/*	Call function to create the main left menu	*/
add_action('admin_menu', array('wpshop_init', 'admin_menu'));
add_action('menu_order', array('wpshop_init', 'admin_menu_order'));
add_action('custom_menu_order', array('wpshop_init', 'admin_custom_menu_order'));
/*	Call function for new wordpress element creating [term (product_category) / post (product)]	*/
add_action('init', array('wpshop_init', 'add_new_wp_type'));
/*	Call function allowing to change element front output	*/
add_action('the_content', array('wpshop_display', 'products_page'), 1);
// add_action('archive_template', array('wpshop_categories', 'category_template_switcher'));
/*	On plugin activation create the default parameters to use the ecommerce	*/
register_activation_hook(__FILE__, array('wpshop_install', 'install_on_activation'));
/*	On plugin deactivation call the function to clean the wordpress installation	*/
register_deactivation_hook(__FILE__, array('wpshop_install', 'uninstall_wpshop'));
/*	Add the database content	*/