mcguffin / the-paste

Paste Images in WordPress from many applications and upload them to the media library.
https://wordpress.org/plugins/the-paste/
GNU General Public License v3.0
40 stars 11 forks source link

Possible to have shorter image names such as date (YYMMDD) or now? #2

Closed fogoat closed 1 year ago

fogoat commented 5 years ago

Hi, is it possible to have shorter image names such as date (YYMMDD) or now?

I'd prefer a configuration like wordpress default permalinks, but I think I could handle a change in the code itself as a permanent change. I see a todo checkbox list marked done but when I installed the latest plugin, the file name still says something pasted into title,

BettyJJ commented 3 years ago

Hi, I'm a fellow user. I searched in the code base and found that the image name is defined in the src here: https://github.com/mcguffin/the-paste/blob/c063e24c036d1519549b75c9f74f1665f0259074/src/js/lib/the-paste-base.js#L41 It seems that you can change the postname part to whatever you like and recompile the source. In the actual plugin, the outputted js file is minified and it's located in the-paste/js/admin/the-paste.js. If you don't want to recompile, this is the file you need to change. Search for pasted_into and you can find the place. As for me, I don't want the hassle so I decided to just paste images before giving the post a long name. 😂