Skip to content

Instantly share code, notes, and snippets.

View ouendinga's full-sized avatar

Álvaro Solís Pascual ouendinga

View GitHub Profile
@ouendinga
ouendinga / api.php
Last active October 24, 2019 13:52
<?php
// Run server: "php -S localhost:8888 api.php"
// get the HTTP method, path and body of the request
$method = $_SERVER['REQUEST_METHOD'];
$request = explode('/', trim($_SERVER['PATH_INFO'],'/'));
$input = json_decode(file_get_contents('php://input'),true);
// connect to the mysql database
@danielbachhuber
danielbachhuber / collection-filter.js
Last active January 29, 2025 04:58
Add a custom taxonomy dropdown filter to the WordPress Media Library
(function(){
/**
* Create a new MediaLibraryTaxonomyFilter we later will instantiate
*/
var MediaLibraryTaxonomyFilter = wp.media.view.AttachmentFilters.extend({
id: 'media-attachment-taxonomy-filter',
createFilters: function() {
var filters = {};
// Formats the 'terms' we've included via wp_localize_script()