Skip to content

Instantly share code, notes, and snippets.

View eddt's full-sized avatar

Edd Twilbeck eddt

  • Ocean Springs, MS
View GitHub Profile
@lgladdy
lgladdy / custom-acf-json-paths.php
Last active January 11, 2024 16:09
ACF 6.2 custom load and save paths for ACF JSON
<?php
add_filter( 'acf/json/load_paths', 'set_custom_json_load_paths' );
function set_custom_json_load_paths( $paths ) {
$paths[] = get_stylesheet_directory() . '/acf-json/post-types';
$paths[] = get_stylesheet_directory() . '/acf-json/field-groups';
$paths[] = get_stylesheet_directory() . '/acf-json/taxonomies';
$paths[] = get_stylesheet_directory() . '/acf-json/option-pages';
return $paths;
}
@jenssogaard
jenssogaard / ACF Gutenberg get block fields
Created February 22, 2019 21:08
Helper class for ACF and Gutenberg. Get blocks fields by passing block_id and post_id.
<?php
namespace JensSogaard;
class BlockHelper
{
/**
* Gets ACF fields for a specific block on a given post
* @author Jens Soegaard <jens@jenssogaard.com>
*/
public function getBlockFromPage(string $block_id, int $post_id)