# Custom Plugin USP

**URL:** <https://foro.wpargentina.org/t/custom-plugin-usp/5013>\
**Category:** Bolsa de Trabajo\
**Created:** [5 Agosto, 2022 06:44 UTC](https://foro.wpargentina.org/t/custom-plugin-usp/5013 "2022-08-05T06:44:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ariasdaniel](https://foro.wpargentina.org/letter_avatar_proxy/v4/letter/a/ecae2f/32.png) [@ariasdaniel](https://foro.wpargentina.org/u/ariasdaniel)\
**Post date:** [5 Agosto, 2022 06:44 UTC](https://foro.wpargentina.org/t/custom-plugin-usp/5013/1 "2022-08-05T06:44:29Z")

</div>

Hello, the idea is to extend the functionality of this plugin: [User Submitted Posts – WordPress plugin | WordPress.org](https://wordpress.org/plugins/user-submitted-posts)

In order to generate a blurred version (using gaussian blur) of each image submitted to a post trough the plugin. So we can use a shortcode similar to usp\_post\_attachments() to show the blurred version of the attachments.

We were making some research and found some interesting code for implementing the blur functionality:

For reference: [[Image Blur – WordPress plugin | WordPress.org](https://wordpress.org/plugins/image-blur/)]  
[php - Modify image while uploading - WordPress Development Stack Exchange](https://wordpress.stackexchange.com/questions/125853/modify-image-while-uploading)

Tasks:

1. We need to add new methods to generate the blurs, maybe inside this function usp\_attach\_images($post\_id, $newPost, $files, $file\_count) i.e. generate\_blurred\_images()

2. We need to modify the function function usp\_post\_attachments($size = ‘full’, $beforeUrl = ‘ ![]()’, $numberImages = false, $postId = false)

i.e. $blurredImages = false  
To know if the blurred version of the images should be displayed instead of the original ones.  
If false: show the original images  
If true: show the blurred images

All the rest of the functionality of the usp plugin will remain the same, no additional work should be made than generate the blurs and override the shortcode function.

More details: [ariasdaniel@hotmail.com](mailto:ariasdaniel@hotmail.com)  
Thanks
