Skip to content

Instantly share code, notes, and snippets.

View shnr's full-sized avatar

Shota Nara shnr

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<?php
// 確率を持つ要素を用意
$arr = array(
array(
"val" => "90%の優先度",
"per" => 90
),
array(
@shnr
shnr / gist:5450510
Created April 24, 2013 08:14
Get post from all blogs on wordpress multisite.
function get_posts_from_all($showposts, $denyBlogs = array()) {
global $wpdb;
// current blog id
$mysiteid = $GLOBALS['blog_id'];
// get child blog ids
$blogList = $wpdb->get_results(" SELECT blog_id FROM $wpdb->blogs ORDER BY blog_id" );