Skip to content

Instantly share code, notes, and snippets.

View SamuelHadsall's full-sized avatar

Samuel Hadsall SamuelHadsall

View GitHub Profile
@SamuelHadsall
SamuelHadsall / acf-update-via-json.php
Created March 5, 2024 16:59 — forked from jessepearson/acf-update-via-json.php
Automatically update Advanced Custom Fields field groups via JSON
<?php
/**
* Function that will automatically update ACF field groups via JSON file update.
*
* @link http://www.advancedcustomfields.com/resources/synchronized-json/
*/
function jp_sync_acf_fields() {
// vars
@SamuelHadsall
SamuelHadsall / README.md
Created August 17, 2023 20:40 — forked from theJasonJones/README.md
Auto Populate Wordpress ACF Repeater values

Add default values to ACF Repeater Fields

I came across this solution when I had about a ton of posts (200+) with values in various PDFs. I didn't want to have to spend time filling out the same values over and over again.

Walkthrough

This case is pretty straight forward; I have one repeater field field_123a56b7cb890 that has a text fields inside it (field_588a24c3cb782). I haven't tried any other types like post objects or radio buttons, but I'm sure it can be done.

Step 1. Hook into acf/load_value on your repeater field. You can use type/key/name as desired here.

@SamuelHadsall
SamuelHadsall / cloudSettings
Last active December 16, 2019 14:04 — forked from daniellmb/calc-rem.js
PX-to-REM Calculator
{"lastUpload":"2019-12-16T14:04:14.609Z","extensionVersion":"v3.4.3"}