Is there an easy way to modify custom post types on the frontend? Maybe you can direct me to a plugin?
For example, I have a custom post type called “Product”. The examples I see online show how I can perform CRUD on products in the dashboard, but is there a way I let a user modify a product on the frontend of the site?
Do I need to write my own crud code for the front end?
I’m from the World of Django, where CRUD is King, so I had a similar question. The best answer I’ve found so far is Pods and the associated Pods UI. Unlike “Custom Posts”, which are kind of weird once you take a look under the hood, Pods actually creates real tables with real fields. Furthermore, you can crate relations! What a concept! Try that with Custom Fields. I haven’t done this for a user-facing page yet, but it makes for a very nice admin-facing input form.
Update in response to comment:
WP doesn’t really have an ORM to speak of. It has
meta
tables (wp_usermeta
,wp_postmeta
, andwp_commentmeta
) to store “extra” information in (this is where new fields are stored for Custom Post Types), but there is none of the very nice lazy-dereferencing you have in a proper ORM.Although relationships (foreign key, one-to-one, and many-to-many) are not natively supported by WP, there are a handful of plugins that address this issue and one of them that may make this situation palatable for you. I haven’t used any of them (yet) so I can’t speak for their relative strengths and weaknesses.
I know plugin Front-end Editor that allows to edit different things on front-end, but not sure how compatible it is with custom post types.