Skip to content

Instantly share code, notes, and snippets.

@rhurling
rhurling / .htaccess
Last active April 23, 2018 08:52
autodiscover.xml generation via php - based on github.com/Radiergummi/php-autodiscover
RewriteEngine On
RewriteRule ^autodiscover.xml$ autodiscover.php [NC,L]
@rhurling
rhurling / sidebar.php
Last active September 24, 2020 07:59
Widget & Sidebar Endpoints for the WordPress REST API v2
<?php
use WP_REST_Server;
use WP_REST_Request;
use WP_REST_Response;
use WP_Error;
class Sidebar extends \WP_REST_Controller {
/**
<?php
# Source: https://gist.github.com/joehoyle/12e37c293adf2bb0ea1b
/**
* Whitelist embedded links in the REST API responses
*
* This is often useful if you want to only get specified resources embedded along with the
* main resources, rather than the "all of nothing" approach of passing `?_embed` to the API request.
*
Verifying that +rhurling is my openname (Bitcoin username). https://onename.com/rhurling

Keybase proof

I hereby claim:

  • I am rhurling on github.
  • I am rhurling (https://keybase.io/rhurling) on keybase.
  • I have a public key whose fingerprint is 1EF1 52DD 1D38 EF21 391A EC65 8439 293B 290D 7F00

To claim this, I am signing this object: