Skip to content

Instantly share code, notes, and snippets.

@PeterBooker
PeterBooker / Dockerfile
Created October 22, 2018 22:19
PHP-FPM Docker
FROM php:7.2-fpm-alpine
#FROM php:7.3.0RC3-fpm-alpine3.8
# install PHP extensions
RUN apk add --no-cache --virtual .build-deps \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev
RUN docker-php-ext-install \
@PeterBooker
PeterBooker / get-posts.php
Last active October 23, 2018 18:39
WP REST API Examples
<?php
/**
* Get Public Posts from External Site using REST API
*/
$hostname = 'https://www.peterbooker.com';
$num = 5;
$response = wp_remote_get(
add_query_arg(
array(