/** * Game Category * * @param type $atts * @return type */ function mc_shortcode_category($atts) { $atts = shortcode_atts(array('id' => 0), $atts); extract($atts); // nothing to do so lets go if (empty($id)) { return; } $mc_games = new miniclip_games(); return $mc_games->embed_category($id); }
/** * Outputs the content of the widget * * @param array $args * @param array $instance */ public function widget($args, $instance) { if (isset($instance['category'])) { if ($instance['category'] > 0) { echo $args['before_widget']; if (!empty($instance['title'])) { echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title']; } $mc_games = new miniclip_games(); echo $mc_games->embed_category($instance['category']); echo $args['after_widget']; } } }