Example #1
0
 /**
  * Initialize WR Library.
  *
  * @return  void
  */
 public static function init()
 {
     global $pagenow;
     // Register Ajax actions
     if ('admin-ajax.php' == $pagenow && isset($_GET['action']) && in_array($_GET['action'], self::$actions)) {
         // Init WordPress Filesystem Abstraction
         WR_CF_Init_File_System::get_instance();
         // Register Ajax actions
         switch ($_GET['action']) {
             case 'wr-addons-management':
                 WR_CF_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_cf_init' action
     do_action('wr_cf_init');
 }
Example #2
0
 /**
  * Render addons management screen.
  *
  * @return  void
  */
 public static function addons()
 {
     // Instantiate product addons class
     WR_CF_Init_Assets::load(array('wr-bootstrap3-css', 'wr-bootstrap3-jsn-gui-css', 'wr-form-css', 'wr-form-js', 'wr-addons-css', 'wr-addons-js'));
     WR_CF_Product_Addons::init(WR_CONTACTFORM_IDENTIFICATION);
 }