mirceatm
Forum Replies Created
-
Forum: Plugins
In reply to: [Store file uploads for Contact Form 7] Get Upload File Name & URLHi,
Currently, this plugin stores the file uploaded with CF7 in media library and is able to output the url to it.
To get the url of the stored file listed in the email sent by CF7, one could try to write code that customizes ContactForm7 email as documented here
Drop a line if you have trouble figuring that out.I’ve briefly consider it, now when you mentioned it.
Looking at the code, something is not yet clear to me:- user uploads a file in CF7
- this plugin gets the filename
- should we change the filename here, if the filename already exists in the media library?
- raise this event/filter:
nmr_create_attachment_file_name
– send the potentially new filename to subscribers – remember this might not be the same filename the user uploaded. Does it matter? I don’t know, but it’s solvable by everyone with a bit of code as pointed above
So, I haven’t implemented it yet. Please consider the reach of this change, how it might affect other websites using it and if you are confident you may contribute the solution.
Yes, you are correct.
You may want to subscribe tonmr_create_attachment_file_name
filter, callwp_unique_filename
and change the file name before the file is saved.Forum: Plugins
In reply to: [Custom Datepicker NMR] Limit The Range of Date Picker to Only One yearHi,
Thanks for testing it out!
Version 1.0.6 has a fix for that.
Regards.Forum: Plugins
In reply to: [Custom Datepicker NMR] Limit The Range of Date Picker to Only One yearHi,
Please try the new version: 1.0.5 – it should contain a fix for the date validation.
RegardsForum: Plugins
In reply to: [Custom Datepicker NMR] Limit The Range of Date Picker to Only One yearHi,
When you setmin
andmax
use this format: yyyy-mm-dd as pointed out in my previous reply.[datepicker* DATA_COMP id:myFirstDatepicker format:ddmmyy min:2022-01-01 max:2022-12-31]
Also, make sure you are using version 1.0.4
RegardsForum: Plugins
In reply to: [Custom Datepicker NMR] Limit The Range of Date Picker to Only One yearHi,
The new version: 1.0.4 should acceptmin
andmax
as follows:[datepicker* myFirstDatepicker id:myFirstDatepicker format:dd.mm.yy min:2022-01-01 max:2022-12-31]
Forum: Plugins
In reply to: [Store file uploads for Contact Form 7] Attach the image to a post on uploadHi,
See this answerImage id (or attachment id) is sent to your callback function that listens for
nmr_create_attachment_id_generated
action.Have fun!
Forum: Plugins
In reply to: [Store file uploads for Contact Form 7] Message does not sendHi,
It’s difficult to say what is not working in this case.
Are there any errors in the browser console after you press Submit?
Are there any errors logged on the PHP error log?Forum: Plugins
In reply to: [Store file uploads for Contact Form 7] Uploaded file attributesHi!
Caption and description could be set by changing$attachment
array received by subscribing tonmr_before_insert_attachment
filter – available from plugin version 1.2.2. See wp_insert_attachment for more detailsAlternate text could be changed once you get the attachment id by listening for
nmr_create_attachment_id_generated
action like below (code not tested):function example_callback_id_generated( $attachment_id ) { // update alt text update_post_meta($attachment_id, '_wp_attachment_image_alt', 'My Alt Text'); } add_action( 'nmr_create_attachment_id_generated', 'example_callback_id_generated', 10, 1 );
- This reply was modified 3 years ago by mirceatm.
Hi!
There is literally another question: Get url of file a few threads back ??When an attachment is uploaded, you’ll get the id and the url by subscribing to an event, or action as it is called in WordPress. It is sent to your event handler function.
To get attachments at a later time, you could try to use WordPress get_posts function with the right parameters
Forum: Plugins
In reply to: [Store file uploads for Contact Form 7] Get url of file – step by stepHi!
I think there’s some misunderstanding here.
This plugin has no shortcode, so writing [nmr_create_attachment_id_generated] (which looks like you want to call a wordpress shortcode) in a Page or Post or Contact Form will not work, unless you add code for a new shortcode called like that. Check the documentation for shortcodes hereAs stated in the plugin description:
This plugin will save uploaded files to Media Library before email is sent by CF7.
This plugin will raise an event with the the full file path & name.The code you posted should react to the event mentioned above and get you the url of the attachment – showing that url in a page, post or contact form is another story. I’m available for small consulting work at mircea @ namir . ro
Forum: Plugins
In reply to: [Custom Datepicker NMR] aria-invalid don t change to false when date emptyHi,
Please try version 1.0.3 to get date validation.Forum: Plugins
In reply to: [Custom Datepicker NMR] aria-invalid don t change to false when date emptyHi,
Thanks for reporting this.
Please try the new version: 1.0.2 – required fields should work now.
Any support is really appreciated – it goes a long way in shortening response times.Forum: Plugins
In reply to: [Store file uploads for Contact Form 7] Directory of stored filesHi!
Using version 1.2.1 (latest) – I’ll probably write something like this in my own plugin or theme (not in Store file uploads for Contact Form 7 plugin):(untested code)
function handle_my_attachments($fullFileName){ $fileName = basename($fullFileName); $dir = dirname($fullFileName); //replace $myDir with your own folder $myDir = "/home/my-account/public_html/wp-content/uploads/2021/12/"; $newFileName = $myDir . $fileName; return $newFileName; } add_filter('nmr_create_attachment_file_name', 'handle_my_attachments');
this will listen to the event/filter nmr_create_attachment_file_name raised from this plugin, and will act on the event, changing the folder of the file.
The plugin will then proceed to save the file in that folder.
Good luck!
Mircea.