Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block murdaugh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am murdaugh on github.
  • I am 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:

murdaugh / copy post to blog function
Created Oct 3, 2013
Copies a post (as well as its associated meta data) from one wordpress blog to another on the same network.
View copy post to blog function
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) {
View custom locale function
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
View spanish strings
array (
murdaugh / gist:2714140
Created May 16, 2012
View gist:2714140
echo flickr_feed('');
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);
You can’t perform that action at this time.