I discovered the "Autofields" plugin earlier this week.
It has a simple function that I am longing for: I am looking for a simple straightforward code to scan my post's content and pick up the first image's address and apply it into a "custom field" box.
And the Autofields plugin does JUST that (I don't know of any other plugins which are able to do this, if there are any then please let me know).
The problem I am having with it is this function is executed whenever you click to add a new tag to your post which might have been fine but then every time you add a new tag you also get a new custom field to go with it and it just keeps adding these junk fields to the post. So say you had a post with 20 tags for instance, then you would also have 20 extra custom fields added to it when all you need is one!! Sure you could delete them all but the Plugin shouldn't be making redundant data. Also if you are to click on publish/update post then the plugin checks to see whether the "image" field has any content but only as a warning for the user, I don't see how this serves any real function? So the initial part of this plugin serves a good function but it is done so in a confusing way that in it's current form creates a lot of junk fields and warns of empty fields which should have been automatically filled as the name "Autofields" suggests
My idea for greatly improving this plugin would be to somehow change the code so that for instance when the user clicks publish/update to check to see whether the "Image" field is filled in OTHERWISE it should THEN scan the content and then add the custom field. Surely this check would stop the repetition of the custom field being constantly created?
And then the next step beyond this would be to allow an option to specify what the custom field should be called so that the user can use it effectively in their theme design.
I don't have a good knowledge of JQuery otherwise I would be giving it a go myself but if all these changes were to be made this would be an awesome-must-have plugin for all the community.
Good Function, Badly Executed
(8 posts) (2 voices)-
Posted 2 years ago #
-
So say you had a post with 20 tags for instance, then you would also have 20 extra custom fields added to it when all you need is one!
Hmm - actually the plugin check for that - and it works fine in my system. Which browser are you using?
Also if you are to click on publish/update post then the plugin checks to see whether the "image" field has any content but only as a warning for the user, I don't see how this serves any real function?
If you don't want this, just go to Settings > Autofields and turn of the custom validation for Images.Posted 2 years ago # -
Thanks for the reply binnyva.
I am currently using Mozilla Firefox and since you have mentioned it I have also just checked the plugin with Internet Explorer; the problem is still the same and it adds another custom field for every tag you add, even if you just click in that box without typing anything in I get another unwanted field.
I have to say that it was very interesting to hear that this doesn't happen for you so I must apologise for implying that this problem I mentioned is a product of bad coding, I guess if it is just me who is suffering this problem then I wonder whether there is some kind of conflict with another plugin that I am using? But to be fair all of the plugins that I use work happily together so I don't understand what the true cause of this problem could be?... But I still have to wonder whether this function could be implemented in another way because what about people who don't use tags in their posts? It is just a shame that I cannot benefit from this plugin.
Thank you for your time.Posted 2 years ago # -
Hello again,
I just wanted you to know that I have not given up on this plugin, but it seems like it has pretty much given up on me!
This week Wordpress 2.8 was released and I have just installed it, as far as I can see everything works great and as it should, except for... Autofields plugin! Okay so before 2.8 it was working albeit not really as I wanted it to work (although I am led to believe that I am the only one it wasn't working for) but now it doesn't seem to do anything!?! No custom fields are added no matter what you do!
Has a change in Wordpress 2.8 made this plugin incompatible or is it still just me that this plugin will not work for?!?
I have great patience and I am determined to get a function like this working on my website.
Cheers.Posted 2 years ago # -
I haven't yet checked my plugin on WP 2.8 - but I will in the coming week. But I am still unsure if I'll be able to fix the problem you are having. I am not able to reproduce your issue in my system - and I cannot fix a bug I cannot reproduce.Posted 2 years ago #
-
I know and I will totally understand if it is just me who cannot benefit from your awesome plugin. Let me know how you get on with 2.8.
Cheers!Posted 2 years ago # -
Try the attached version and let me know how it goes.Posted 2 years ago #
-
Hello again,
I have been busy testing different ideas and theories - determined to get this thing to work.
Firstly I tried your attached version but no luck I'm afraid, well actually excerpts worked fine and didn't duplicate the output as previously observed but nothing happens with the custom field bit.
Then I tried deactivating all my installed plugins, thinking if they are incompatible for some reason, but no luck there either.
Then I wondered whether it was just my Theme and something corrupt in that and tried your plugin by itself with the default theme but couldn't get that to work either.
Sorry my friend, I can see you've changed the code to accommodate changes in 2.8 but I still can't get this working the way I want it to.
But, and I don't know if this will help but I noticed that a plugin in Firefox had detected an error when trying to execute the function which reads as follows:
found_image_custom_field is not defined
autofields_getContents()
(?)()()
(?)()()
if(found_image_custom_field) return;
I don't know what this means exactly or if it could help to solve this mystery. Nevertheless I'm still not giving up!!!Posted 2 years ago #
Reply
You must log in to post.