Skip to content

Instantly share code, notes, and snippets.

View landjonathan's full-sized avatar

Jonathan Land landjonathan

View GitHub Profile
<?php
function renderForm ($endpoint) {
// get the data from the API and convert it to a PHP object
$formResult = file_get_contents($endpoint);
$formContent = json_decode($formResult);
$formFields = $formContent->fields;
// start building the DOM
$dom = new DOMDocument();
$form = $dom->createElement('form');
@landjonathan
landjonathan / acf-field-group-schema.json
Last active March 6, 2022 08:30 — forked from friartuck6000/acf-field-group-schema.json
JSON schema for Advanced Custom Fields (ACF) field groups
{
"$schema": "http://json-schema.org/schema#",
"id": "http://advancedcustomfields.com/json-schema/field_group",
"type": "object",
"definitions": {
"empty": {
"type": "string",
"maxLength": 0
},
"intOrEmpty": {
@landjonathan
landjonathan / shortcodes-in-titles.php
Created November 10, 2022 08:15
Add shortcodes to Wordpress titles
// core WP titles
add_filter('the_title', 'do_shortcode');
add_filter('wp_title', 'do_shortcode');
// add to Yoast generated titles
// page title
add_filter('wpseo_title', 'do_shortcode');
// schema -> webpage title
add_filter('wpseo_schema_webpage', function ($data) {