function widget($args, $instance) { // Widget output extract($args, EXTR_SKIP); $no_news = empty($instance['no_news']) ? get_option("kush_mn_num_news", '5') : apply_filters('no_news', $instance['no_news']); $news_cat = empty($instance['news_cat']) ? 'default' : apply_filters('news_cat', $instance['news_cat']); $news_header = empty($instance['news_header']) ? get_option("kush_mn_head_enable", 'true') : apply_filters('news_header', $instance['news_header']); echo $before_widget; echo kush_micro_news_output($no_news, $news_header, "0", "false", $news_cat); echo $after_widget; }
function kush_micronews_ajaxcallback() { if (isset($_POST['what']) && $_POST['what'] != "") { if ($_POST['what'] == "loadmore" || $_POST['what'] == "loadhome") { $what = $_POST['what']; $number = $_POST['numnews']; $cat = empty($_POST['cat']) ? 'default' : $_POST['cat']; $loops = "0"; if (isset($_POST['loop'])) { $loops = $_POST['loop']; } $limit = $number * $loops; //from where to start $newsdata = kush_micro_news_output($number, "false", $limit, "true", $cat); if ($newsdata != '<div class="data-holder"></div>') { echo $newsdata; } else { echo '0'; } die; } } }