-
Notifications
You must be signed in to change notification settings - Fork 7
Develop #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Develop #22
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| <?php | ||
|
|
||
| class AcfCustomJsonData | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The classname should be more clear to tell it's responsibility. |
||
| { | ||
| private static $acf_custom_json_data; | ||
|
|
||
| private static $theme_path = '/inc/acf-json'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| private function __construct() | ||
| { | ||
| } | ||
|
|
||
| public static function get_json_data_path($default_path) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not have such a global access modifier. Please make it private along with moving |
||
| { | ||
| $path = get_stylesheet_directory() . self::$theme_path; | ||
| if (!file_exists($path)) mkdir($path); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| return $path; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * acf設定を保存 | ||
| * 2018.05.12 | ||
| * author:ryota moiryama | ||
| */ | ||
| function my_acf_json_save_point($path) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not enclosing this into |
||
| { | ||
| return AcfCustomJsonData::get_json_data_path($path); | ||
| } | ||
| //add_filter('acf/settings/save_json', 'my_acf_json_save_point'); | ||
|
|
||
| /** | ||
| * acf設定を呼び出し | ||
| * 2018.05.12 | ||
| * author:ryota moiryama | ||
| */ | ||
| function my_acf_json_load_point($paths) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
| { | ||
| return array(AcfCustomJsonData::get_json_data_path($paths)); | ||
| } | ||
| //add_filter('acf/settings/load_json', 'my_acf_json_load_point'); | ||
|
|
||
| /** | ||
| * ダッシュボードにオプションページを設置 | ||
| * 2018.05.12 | ||
| * author:ryota moiryama | ||
| */ | ||
| function display_acf_option_page() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
| { | ||
| if (function_exists('acf_add_options_page')) { | ||
| acf_add_options_page(array( | ||
| 'page_title' => "OPTION", | ||
| 'menu_title' => "OPTION", | ||
| 'menu_slug' => 'acf-options', | ||
| )); | ||
| } | ||
| } | ||
| //add_action('init','display_acf_option_page'); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should be made on different PR since they are completely unrelated.