Skip to content

Instantly share code, notes, and snippets.

View thsneumann's full-sized avatar

Thomas Neumann thsneumann

  • Berlin
View GitHub Profile
<?php
/*** Add Advanced Custom Fields to REST API GET Response ***/
/*** tested in WP4.7.3 with ACF4.4.11
/*** https://support.advancedcustomfields.com/forums/topic/json-rest-api-and-acf/ ***/
add_filter('rest_prepare_post', 'rest_api_encode_acf', 10, 3);
function rest_api_encode_acf($response, $post, $request) {
if (!function_exists('get_fields')) return $response;
if (isset($post)) {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Toggle Button</title>
<style>
.tabs .tab:not(.selected) {
display: none;
}
@thsneumann
thsneumann / DNN_viewport_meta
Created December 3, 2015 15:39
Set viewport meta tag in DNN Skin
<%@ Register TagPrefix="dnn" TagName="META" Src="~/Admin/Skins/Meta.ascx" %>
<dnn:META ID="mobileScale" runat="server" Name="viewport" Content="width=device-width,initial-scale=1" />
@thsneumann
thsneumann / 0_reuse_code.js
Created November 11, 2015 11:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console