This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) |