/**
  * ajax callback to print skin config
  */
 public static function _hw_display_pretty_skin_enqueue()
 {
     if (!wp_verify_nonce($_REQUEST['nonce'], "_hw_display_pretty_skin_enqueue_nonce")) {
         exit("No naughty business please");
     }
     if (!isset($_REQUEST['config_id'])) {
         echo 'Không tìm thấy config này';
         return;
     }
     if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
         //$result = json_encode($result);
         $setting = hwskin_get_skins_enqueues(array('id' => $_REQUEST['config_id']));
         if (count($setting)) {
             $skin = reset($setting);
             $skin_info = $skin->instance->get_skin_info($skin->hash_skin);
             #$t=new HW_SKIN();$t->get_skin_info()
             include dirname(__FILE__) . '/template/pretty-skinconfig.php';
         }
     } else {
         header("Location: " . $_SERVER["HTTP_REFERER"]);
     }
     die;
 }
Ejemplo n.º 2
0
/**
 * get all actived skins
 * @param $where
 */
function hwskin_get_actived_skins($where = array())
{
    $where['status'] = '1';
    return hwskin_get_skins_enqueues($where);
}