Skip to content

Instantly share code, notes, and snippets.

View BetterXMLElement.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 / fileupload.api.php
Created Sep 23, 2015
Wordpress JSON API Controller for media upload
View fileupload.api.php
* Plugin Name: JSON API - Media Controller
* Version: 0.0.1
* Author: Eric Mulder
* Author URI:
* Plugin URI:
* 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];
NSSortDescriptor *sortDescriptor;
You can’t perform that action at this time.