Before I created the block, I used a get_field (“field_name”, “Options”) in Functions.php.
If I swap these lines, the block works.
The function get_field blocks the rendering of the blocks.
I had a simple query whether the block should be active in an option page with ACF fields.
Is it possible that there is a bug here?
I do not think so. The info page says that the folder “acf-json” is one of the load points. If you look in the code of ACF, then you see that there are many folders possible. With unset I remove one of these load points. But that is not, what i want. I want many load points.
In the plugin i want to load the fields for all my sites. In the theme i want to load the fields for a special page.
Please have also a look at the comment over the line with unset
// remove original path (optional)
I don’t want to remove this path. I will use it, too.
And how i said: It didn’t solve the problem.
If i use var_dump in acf_json_load_point nothing would be displayed.
Hello @beee,
this didn’t solve the problem.
I have removed this line, because the json from the template is also not loaded any more.
Thanks for the try.
Used a plugin. Pictures from Users are no longer in the Media Libary.
Solved for my own.
@hube2 I’ve tried this, but it doesn’t work.
I created the fields locally and moved it to the server. Both files (functions.php – local and server) have both functions: one for loading and one for saving. There are no other field groups on the live server.
The fields are not displayed on post edit and the options page are empty two.
What is wrong?
EDIT:
I’ve do this in the Master-Theme. If i do it in the child theme it works. But only in the folder “acf-json”. Not in my folder /json-sync/.
I want to use the fields with all themes (4) on all servers. Also i put it in a plugin.
Saving Works great with this function
add_filter('acf/settings/save_json', 'bks_acf_json_save_point');
function bks_acf_json_save_point( $path ) {
// update path
$path = plugin_dir_path( __DIR__ ) . '/acf-json';
// return
return $path;
}
Loading with this funtion don’t works.
add_filter('acf/settings/load_json', 'bks_acf_json_load_point');
function bks_acf_json_load_point( $paths ) {
// append path
$paths[] = plugin_dir_path( __DIR__ ) . '/acf-json';
// return
return $paths;
}
@kokers This Solution don’t works for me.
Hello,
I have the same problem. But this solution/workaround don’t works for me. If i use the workaround i get only a blank page.
In the new install it was 14 and 14.
Hello John,
i use Version 5.5.10 ACF Pro.
If tried it on a fresh install. There is the same problem.
If i change the term with the same ID like the post, the post entry will be overwritten. If i change the post, the term will be overwritten.
Hello @acf-support,
This function is still alive and works fine.
You wrote:
“Maybe you can copy the files to the new location, get the URL to the new location and then delete the attachment by using the wp_delete_attachment() function?”
“Maybe you can copy the files to the new location”
-> this works fine.
“get the URL to the new location”
-> I have the url.
“and then delete the attachment by using the wp_delete_attachment() function”
-> I wanted to do so when nothing works. I create so but a lot IDs in wp_posts. I was looking for a better solution.
I wanted to do this with a filter for “save_post”. I delete first the attachment from the media library and then i overwrite the attachment_id with the url of to the new location. Right?
excuse my bad English.
Greetings
Skrabbel
Thanks for the fix! I’m very happy with this.
Hi @acf-support
this is the plan, if nothingelse will work.
I create “only” many IDs.
And with a filter for “save_post” i rewrite the value for the custom field. Otherwise it used the id of the attachment. Right?
Hello @acf-support,
sorry my english is terrible.
I want to upload a file. But i don’t want an insert in the media library.
My problem isn’t the upload. The file is at the right place and so on.
My problem is the automatic in acf to create after upload this attachment insert in the database.
I use a filter for wp_handle_upload_prefilter
– but after this it starts ever the function acf_upload_files();
. I look for a way to prevent or to stop this. Because this function create the media library insert. I don’t want this insert.
I will upload advertising images. These images has only one size! And i don’t need the other formats.
I can upload, but i can’t the insert in the database and the media libary.
Thanks vor your help!
Greetings
Skrabbel
I found the problem. I use this Date Time Picker Field
The new version works correctly with this 3rd party acf field. I need it – because my posts work with this. Also i revert acf pro.
Thanks for your help.
Hello James,
Debug is on the dev-system always on. There is nothing. Only a blank page. I get only an error if change the database password. Then i see Warning: mysqli_real_connect(): (HY000/1045): Access denied for user ##### (using password: YES) in ####wp-includes\wp-db.php on line 1490
and so on.
I can’t swich the theme after updating acf pro, because I can’t enter the administration area.
If i switch it before, it is the same. But i find out an other aspect. If i won’t to switch back to an older version. I must copy the old version to the plugin-folder and replace the database with a backup, too.
Greetings
I was looking for a solution for the same problem, but this isn’t a solution. Because the data exists in a database and sort them with php in this way is for a few more dates inperformant and not useable with paginations and so on.
Same issue. Is where an alternative to add a time field?
Thank You!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.