{"id":117950,"date":"2020-02-28T06:15:13","date_gmt":"2020-02-28T06:15:13","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/store-file-uploads-for-contact-form-7\/"},"modified":"2024-06-07T20:28:54","modified_gmt":"2024-06-07T20:28:54","slug":"store-file-uploads-for-contact-form-7","status":"publish","type":"plugin","link":"https:\/\/fr.wordpress.org\/plugins\/store-file-uploads-for-contact-form-7\/","author":17805734,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2.3","stable_tag":"1.2.3","tested":"6.5.8","requires":"4.9","requires_php":"","requires_plugins":null,"header_name":"Store file uploads for Contact Form 7","header_author":"Mircea N.","header_description":"Store all files uploded trough Contact Form 7 in your Media Library","assets_banners_color":"","last_updated":"2024-06-07 20:28:54","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/paypal.me\/mirceatm","header_plugin_uri":"https:\/\/namir.ro\/store-file-uploads-for-contact-form-7\/","header_author_uri":"","rating":5,"author_block_rating":0,"active_installs":1000,"downloads":13461,"num_ratings":7,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"mirceatm","date":"2021-01-29 18:17:51"},"1.1.0":{"tag":"1.1.0","author":"mirceatm","date":"2021-05-16 20:00:15"},"1.2.0":{"tag":"1.2.0","author":"mirceatm","date":"2021-10-21 21:09:02"},"1.2.1":{"tag":"1.2.1","author":"mirceatm","date":"2021-12-02 19:27:44"},"1.2.2":{"tag":"1.2.2","author":"mirceatm","date":"2022-03-19 09:11:00"},"1.2.3":{"tag":"1.2.3","author":"mirceatm","date":"2024-06-07 20:28:54"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":7},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.1.0","1.2.0","1.2.1","1.2.2","1.2.3"],"block_files":[],"assets_screenshots":{"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":2251754,"resolution":"1","location":"assets","locale":""}},"screenshots":{"1":"screenshot-1.jpg"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[360,260,361,1980,259],"plugin_category":[41,42],"plugin_contributors":[182471],"plugin_business_model":[],"class_list":["post-117950","plugin","type-plugin","status-publish","hentry","plugin_tags-contact","plugin_tags-file","plugin_tags-form","plugin_tags-library","plugin_tags-upload","plugin_category-communication","plugin_category-contact-forms","plugin_contributors-mirceatm","plugin_committers-mirceatm"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/store-file-uploads-for-contact-form-7.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/store-file-uploads-for-contact-form-7\/assets\/screenshot-1.jpg?rev=2251754","caption":"screenshot-1.jpg"}],"raw_content":"<!--section=description-->\n<p>By default, <a href=\"https:\/\/wordpress.org\/plugins\/contact-form-7\/\">Contact Form 7<\/a> dose not keep data it sends trough it's contact forms.\nWhile plugins like <a href=\"https:\/\/wordpress.org\/plugins\/flamingo\/\">Flamingo<\/a> save that data,  uploaded files are not added to Media Library.\nThis plugin will save uploaded files to Media Library before email is sent by CF7.\nThis plugin will raise an event with the the full file path &amp; name. \nSubscribe to <code>nmr_create_attachment_file_name<\/code> filter to get and\/or update data before attachment is added to media library.<\/p>\n\n<pre><code>\/\/ The filter callback function.\nfunction example_callback( $file_name ) {\n    \/\/ (maybe) modify $file_name.\n    return $file_name;\n}\nadd_filter( 'nmr_create_attachment_file_name', 'example_callback', 10, 1 );\n<\/code><\/pre>\n\n<p>Subscribe to <code>nmr_before_insert_attachment<\/code> filter to be able to change attachment attributes:  caption and description are \u2018post_excerpt\u2019 and \u2018post_content\u2019.\nFor other attributes, check documentation for <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_insert_attachment\/\">wp_insert_attachment<\/a>.<\/p>\n\n<pre><code>\/\/ The filter callback function.\nfunction before_insert_attachment_callback( $attachment ) {\n    \/\/ (maybe) modify $attachment array.\n    return $attachment;\n}\nadd_filter( 'nmr_before_insert_attachment', 'before_insert_attachment_callback', 10, 1 );\n<\/code><\/pre>\n\n<p>Optionally, subscribe to <code>nmr_should_skip_save_attachment_to_media_library<\/code> filter to be able to skip saving the attachment to media library: return true to skip, false is the default behaviour that saves the attachment to media library. Filter <code>nmr_before_insert_attachment<\/code> will not be called if skip was true.<\/p>\n\n<pre><code>\/\/ The filter callback function.\nfunction skip_media_library_callback( $skip_save_to_media_library ) {\n    \/\/ return true to skip saving to Media Library, false to save.\n    return true;\n}\nadd_filter( 'nmr_should_skip_save_attachment_to_media_library', 'skip_media_library_callback', 10, 1 );\n<\/code><\/pre>\n\n<p>This plugin will send the final attachment id if you are interested in getting other details, like attachment url.\nListen to <code>nmr_create_attachment_id_generated<\/code> action.<\/p>\n\n<pre><code>\/\/ The action callback function.\nfunction example_callback_id_generated( $attachment_id ) {\n    \/\/ (maybe) do something with the args.\n    $url = wp_get_attachment_url( $attachment_id );\n}\nadd_action( 'nmr_create_attachment_id_generated', 'example_callback_id_generated', 10, 1 );\n<\/code><\/pre>\n\n<h4>Docs &amp; Support<\/h4>\n\n<p>Check the <a href=\"https:\/\/wordpress.org\/support\/plugin\/store-file-uploads-for-contact-form-7\/\">support forum<\/a> on WordPress.org. If you can't locate any topics that pertain to your particular issue, post a new topic for it.<\/p>\n\n<h4>Store file uploads for Contact Form 7 Needs Your Support<\/h4>\n\n<p>It is hard to continue development and support for this free plugin without contributions from users like you. If you enjoy using -Store file uploads for Contact Form 7- and find it useful, please consider <a href=\"https:\/\/paypal.me\/mirceatm\"><strong>making a donation<\/strong><\/a>. Your donation will help encourage and support the plugin's continued development and better user support.<\/p>\n\n<h4>Privacy Notices<\/h4>\n\n<p>With the default configuration, this plugin, in itself, does not:<\/p>\n\n<ul>\n<li>track users by stealth;<\/li>\n<li>write any user personal data to the database;<\/li>\n<li>send any data to external servers;<\/li>\n<li>use cookies.<\/li>\n<\/ul>\n\n<p>It will, however store uploaded files trough Contact Form 7 in Wordpress Media Library.\nMake sure your website users are aware of this fact!!!<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the entire  folder to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress.<\/li>\n<\/ol>\n\n<p>After that check Media Library for uploaded files.<\/p>\n\n<!--section=changelog-->\n<h4>1.2.3<\/h4>\n\n<p>Add support for skipping saving to Media Library by using <code>nmr_should_skip_save_attachment_to_media_library<\/code> filter<\/p>\n\n<h4>1.2.2<\/h4>\n\n<p>Add support for changing attachment attributes using <code>nmr_before_insert_attachment<\/code> filter<\/p>\n\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>Added support for media uploads (including mp3)<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Added filter <code>nmr_create_attachment_file_name<\/code> and action <code>nmr_create_attachment_id_generated<\/code><\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Contact Form 7 <code>WPCF7_Submission::get_instance()-&gt;uploaded_files<\/code> changed in CF7 5.4, so adjustments in this plugin were needed.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First version.<\/li>\n<\/ul>","raw_excerpt":"When this is active, attachments sent trough Contact Form 7 shortcode [file ] will be stored in your Media Library","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/117950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=117950"}],"author":[{"embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mirceatm"}],"wp:attachment":[{"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=117950"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=117950"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=117950"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=117950"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=117950"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=117950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}