robinzimmer1989
Forum Replies Created
-
That would be great and thank you so much!
Let me know if you have any questions.Robin
Forum: Plugins
In reply to: [Advanced Forms for ACF] Email attachment missingHi Fabian, I’ve found a nice hook to change the filename, but I have problems to check for a AF form submission as you suggested. For now I just check if the file gets uploaded via the frontend or backend by inspecting the url.
Do you have a more elegant solution for this?
<?php function renameUploadedFiles($filename) { $info = pathinfo($filename); $ext = empty($info['extension']) ? '' : '.' . $info['extension']; $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; if (strpos($url, 'wp-admin') == false): $filename = bin2hex(openssl_random_pseudo_bytes(16)); endif; return $filename . $ext; } add_filter('sanitize_file_name', 'renameUploadedFiles', 10); ?>Forum: Plugins
In reply to: [Advanced Forms for ACF] Post Object / Relationship field not workingHi there, I figured out what the issue was. I run a function which adds a ‘defer’ string to all js files to increase the page speed. When I remove this function everything works as expected.
Is there a way to load all AF related js scripts in the footer instead of inline?
Best regards
RobinForum: Plugins
In reply to: [Advanced Forms for ACF] Email attachment missingHi Fabian, okay I guess I found the error:
I changed the return value of the acf field from “File URL” to “File Array” and now the link is showing up in the email.Is there a way to change the filename during the upload process with a hook?
Best regards
Robin