First of all, I’m no developer and my knowledge of PHP is laughable at best. I’m just an enthusiast that likes to get his hands dirty so please be kind to me 🙂
So to my question:
I’m creating a market place for WordPress using the excellent YITH Multi Vendor plugin and I’m having a moderate success using ACF to expand each Vendor profile capability. The plugin itself comes with a WYSIWYG editor used to describe their Shop Profile so I created 2 more fields using ACF and included it in the front end with success.
If I’m an admin, I can go to each Vendor profile and add their newly created fields with no problem, however, if I log in as one of the Vendors and try to edit my profile there, the fields don’t show at all.
So I hacked my way into the actual file that manages the Vendor profiles and display that data for editing in the backend and I just added the following line in the relevant section:
<?php the_field('brand_impact', 'yith_shop_vendor_'.$vendor->id); ?>
This actually show what’s inside, but no editor to be found.
I thought that since the field was created as a WYSIWYG field, it would show and editor there? Obviously I’m doing something wrong due to my inexperience but can any good soul help me out with this task?
Thanks so much in advance,
I don’t know much about the YITH Multi Vendor plugin. ACF works by adding field groups to existing editors for posts, terms, users and it’s own options pages. It cannot automatically add field groups to the admin pages of other plugins that do not use one of these things.
Like you see, you needed to alter the admin page to display the field. It might be possible to use acf_form() https://www.advancedcustomfields.com/resources/acf_form/ to do what you want. You would need to edit all of the plugin’s admin pages and add an acf form to them. You would set the
form option to false and insert the form inside the existing form on the page.
Hello and thanks for your answer.
I probably didn’t explain correctly, but the fields with their full editor already shows up in the profile of each vendor if I log in as a super admin and edit their profiles.
Now, when the vendor log in with their credentials, they don’t see that field and I would like to add that to their vendor profile page.
There is only one file where all their fields show, called “vendor_front_page.php” and I would like to know how to add the code in order to call that field there. I thought that the code I pasted would be enough but that only adds the content of the field correctly but no editor.
Thanks again in advance,
…only adds the content of the field correctly but no editor.
If you want there to be an editor to change the field, wherever it is that you want it to be. then you need to use acf_form() like I said above. https://www.advancedcustomfields.com/resources/acf_form/
Thanks a lot again for your patience with someone like me 🙂 I really appreciate it and I’m sorry for the dumb questions.
I did what you asked and thanks to other very useful posts around in these forums, I could kind of do what I wanted.
I inserted the acf_form() inside the form already in place in the Vendor profile page with the ‘form’ option set to false but I can’t manage to save the data when pressing the “Save” button. The acf_form_head(); is also included in the template.
So the solution for the moment is to have 2 “Update” buttons in place, for both forms.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2023 Advanced Custom Fields.