Insert Data into Database

You can handle that with sending the form to the script admin-post.php with that in the form : <form method=”POST” action=”<?php echo admin_url(“admin-post.php”);?>?action=myPlugin__save_datas”> after that, you use this hook for the PHP treatment add_action(“admin_init”, function () { if ( !isset($_POST[“action”]) || (“myPlugin__save_datas” !== $_POST[“action”]) ) { return; } // save datas // … // redirection … Read more

Many to many relationship for variable products

a. If your fine with a plugin dependency, ACF has this kind of functionality built in with the “Relationship” field. Relationship: https://www.advancedcustomfields.com/resources/relationship/ Reverse Query: https://www.advancedcustomfields.com/resources/querying-relationship-fields/ b. If you want to do this with just WP core, you would use custom fields. First, on the child product, store the IDs of the product pages it should … Read more