I hereby claim:
- I am murdaugh on github.
- I am murdaugh (https://keybase.io/murdaugh) on keybase.
- I have a public key whose fingerprint is BC4A 3992 7AD1 C06E C767 80BE 28B9 5F95 8B4F C627
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<?php | |
function copy_post_to_blog($post_id, $target_blog_id) { | |
$post = get_post($post_id, ARRAY_A); // get the original post | |
$meta = get_post_meta($post_id); | |
$post['ID'] = ''; // empty id field, to tell wordpress that this will be a new post | |
switch_to_blog($target_blog_id); // switch to target blog | |
$inserted_post_id = wp_insert_post($post); // insert the post | |
foreach($meta as $key=>$value) { | |
update_post_meta($inserted_post_id,$key,$value[0]); | |
} |
<?php | |
function my_strftime($format,$time=null) { | |
global $my_locale; //this is set in the header as either en_US or es_ES | |
if($time == null) $time = time(); //if the time isn't passed in, then use the current timestamp | |
if($my_locale == "en_US") return strftime($format,$time); //If it's american english, just format the time as requested | |
else { //in my case, the only other option is es_ES, but this could be changed for whatever purposes you have | |
global $es_locale_string; | |
// we only care about day names and abbreviations and |
array ( | |
"weekday"=>array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"), | |
"weekday_initial"=>array("D","L","M","M","J","V","S"), | |
"weekday_abbrev"=>array("Dom","Lun","Mar","Mie","Jue","Vie","Sab"), | |
"month"=>array("enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"), | |
"month_abbrev"=>array("ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic") | |
); |
<?php | |
echo flickr_feed('http://api.flickr.com/services/feeds/photos_public.gne?id=12345678@N06&format=json&nojsoncallback=1'); | |
function flickr_feed($url) { | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$output = curl_exec($ch); | |
curl_close($ch); |