During CRUD process: upon INSERT , I am able to auto capture user_name ($$USERID$$) , create timestamp ($$NOWDT$$) and store them in the table.
But, during the UPDATE, the auto_capture doesn’t work, because, default value only works with the underline field is empty.
Any idea, how to handle this use-case?
My suggestion: In the template setup, add a new checkbox if the default column has a value then display a checkbox — checkbox can be called “override upon update” screenshot (https://drive.google.com/file/d/14AY9doT9NTl3EkmSoPA0hlrUKHwJqRe6/view?usp=sharing)
in the backend, WPDA, if the box is checked, take the default value and pass to an update statement. if the box is checked, but default value is empty then ignore it.
Happy to discuss further if required.
thanks
Rahim
]]>Thanks for any info on how to create this frontend CRUD to my custom table.
Dean-O
The same question is about custom products table.
P.S. I speak about CRUD and MySQL tables optimization.
]]>Is there a way to use this operation to allow CRUD operations from the frontend? So a user can open up the page (not the wp-admin page ) and press something like “add new post”, fill out some info, press upload, and have their post uploaded to the database?
Thank you
]]>Im using the ‘woocommerce_rest_check_permissions’ filter to prevent users from the API from editing products that are not theirs. My development on this is working great so far, but Im trying to prevent users from editing variations of PRODUCTS that arent theirs and I cant make it work, the $object_id is always 0 for some reason.
EXAMPLE: I have the product with id 500, this product belongs to someone else and I cannot touch it, HOWEVER, I can edit, create, list and delete variations from this product (products/500/variations/501, for example, and delete the variation), even though the parent product is not mine. How can I prevent this from happening ?
Thank you in advance!
]]>