Skip to content

Commit

Permalink
Merge pull request #8 from zackcote/zc/local-acf-json
Browse files Browse the repository at this point in the history
local acf json
  • Loading branch information
atticoos committed Jul 14, 2015
2 parents 956e255 + e3982eb commit 5e99a37
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
bower_components
assets/dist
*.sublime-*
3 changes: 3 additions & 0 deletions assets/acf_local_json/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

// Silence is Golden
21 changes: 20 additions & 1 deletion lib/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function widgets_init() {
* Registers nav menus
*/
function nav_menus_init() {
register_nav_menus(array (
register_nav_menus(array(
'header' => 'Site Navigation',
'footer_social' => 'Social Links',
'footer_organize' => 'Organize Links'
Expand All @@ -49,3 +49,22 @@ function admin_menu_overrides() {
'menu' => 'Theme Options'
));
}

/**
* ACF Local JSON
*/

// save custom fields
function acf_json_save($path) {
$path = get_stylesheet_directory() . '/assets/acf_local_json';
return $path;
}
add_filter('acf/settings/save_json', __NAMESPACE__ . '\\acf_json_save');

// load custom fields
function acf_json_load($paths) {
unset($paths[0]);
$paths[] = get_stylesheet_directory() . '/assets/acf_local_json';
return $paths;
}
add_filter('acf/settings/load_json', __NAMESPACE__ . '\\acf_json_load');

0 comments on commit 5e99a37

Please sign in to comment.