/** * Initialize WR Library. * * @return void */ public static function init() { global $pagenow; if ('admin-ajax.php' == $pagenow && isset($_GET['action']) && in_array($_GET['action'], self::$actions)) { // Init WordPress Filesystem Abstraction WR_Megamenu_Init_File_System::get_instance(); // Register Ajax actions switch ($_GET['action']) { case 'wr-addons-management': WR_Megamenu_Product_Addons::hook(); break; } } // Add filter to fine-tune uploaded file name add_filter('wp_handle_upload_prefilter', array(__CLASS__, 'wp_handle_upload_prefilter')); // Do 'wr_megamenu_init' action do_action('wr_megamenu_init'); }
/** * Render addons management screen. * * @return void */ public static function addons() { // Instantiate product addons class WR_Megamenu_Init_Assets::load(array('wr-addons-js')); WR_Megamenu_Product_Addons::init(WR_MEGAMENU_IDENTIFIED_NAME); }