Skip to content

Instantly share code, notes, and snippets.

ericmulder

Block or report user

Report or block ericmulder

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
View BetterXMLElement.php
<?php
class BetterXMLElement extends SimpleXMLElement {
//appends this xml to a parent
public function appendToSimpleXML(SimpleXMLElement $parent) {
$toDom = dom_import_simplexml($parent);
$fromDom = dom_import_simplexml($this);
$toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true));
}
@ericmulder
ericmulder / fileupload.api.php
Created Sep 23, 2015
Wordpress JSON API Controller for media upload
View fileupload.api.php
<?php
/**
* Plugin Name: JSON API - Media Controller
* Version: 0.0.1
* Author: Eric Mulder
* Author URI: https://emdevelopment.nl
* Plugin URI: https://emdevelopment.nl
* Description: Extensions to the JSON API plugin, to enable file upload
* Licence: GPLv2+
*/
View gist:3897504
//How to sort the following list?
//Array with NSStrings:
[NSArray arrayWithObjects:@"0.0 Title", @"1.1 Title", @"1.10 Title", @"1.11 Title", @"1.12 Title", @"1.2 Title", @"10.1 Title",@"10.11 Title",@"10.2 Title",@"2.1 Title", nil];
Solution:
NSSortDescriptor *sortDescriptor;
You can’t perform that action at this time.