. */ function wp_json_check_url(){ if(preg_match('/\/feed\/json\//', $_SERVER['REQUEST_URI']) || $_REQUEST['feed'] == 'json') { //header('Content-Type: application/json; charset=' . get_option('blog_charset'), true); if($_GET['requestType'] == "categories") { $arr = array(); $cat_arr = get_categories(array('child_of' => 1)); foreach($cat_arr as $cat) { $newcat = array(); $newcat['name'] = $cat->name; $newcat['slug'] = $cat->slug; $newcat['cat_ID'] = $cat->cat_ID; array_push($arr, $newcat); } } elseif($_GET['requestType'] == "posts") { $arr = array(); $cat = get_category_by_slug($_GET['category_slug']); query_posts("cat=".$cat->term_id); $pattern = '/src=[\'"]?([^\'" >]+)[\'" >]/'; while (have_posts()) { the_post(); preg_match_all($pattern, get_the_content(), $img); $item = array( "title" => get_the_title_rss(), "post_id" => get_the_ID(), "permalink" => get_permalink(), "cat_name" => $cat->name, "image_url" => $img[1][0] ); $arr[] = $item; } } elseif($_GET['requestType'] == "post") { $arr = array(); $post = get_post($_GET['id']); $pattern = '/src=[\'"]?([^\'" >]+)[\'" >]/'; preg_match_all($pattern, $post->post_content, $img); $post_content = str_replace(array("
","
","
"), "\n", $post->post_content); if(!empty($post)) { $arr['title'] = $post->post_title; $arr['date'] = $post->post_date; $arr['content'] = strip_tags($post_content); $arr['image_url'] = $img[1][0]; } } if(function_exists('json_encode')) { die(json_encode($arr)); } else { //TODO: Add backwards compatibility to before PHP 5.2 require_once("lib/json.php"); $json = new Services_JSON(); die($json->encode($arr)); } } } add_action('init','wp_json_check_url'); ?> sake – Inspired2cook.com

Archives: sake

Korean-Style Marinated Skirt Steak

May 9, 2012 | By andrea | Comments Off on Korean-Style Marinated Skirt Steak | Filed in: Asian, Beef, Main Dish, Quick Cooking, Recipes.

Had a bad day? Then make this Korean-inspired skirt steak. You see, you get to take out your aggression on the steak by pounding it with a meat mallet. I call that Kitchen Therapy! The quickly marinated and seared steak is tender, flavorful and super easy to make…perfect for a weeknight meal! Serve with steamed jasmine • Read More »

Tags: , , , , , , ,

Spicy Green Beans with Pork

August 30, 2011 | By andrea | 1 Comment | Filed in: Asian, Main Dish, Quick Cooking, Recipes.

Sure, take-out is great but recipes like this one for Spicy Green Beans with Pork make it a cinch to whip up at home: tender pieces of stir-fried pork and green beans in a tasty Asian-flavored sauce. It’s a perfect weeknight meal! As with any stirfry, it’s important to have all the ingredients prepped, measured out and ready • Read More »

Tags: , , , , , , , , , , , ,