[Resuelto] cred_save_data : How to write in the database for non std tables
This support ticket is created hace 6 años, 9 meses. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
Hello,
I have a Cred user form that creates new users and allow them a specific role. In the same time, I need to add some information to a specific table (different from wp_user or wp_usermeta)
Prior to create the cred_save_data into the function.php, I'm trying to test the code by creating a specific page and call it directly. So, I created the wpupdate.php page in the directory root and can lunch it thnaks to enlace oculto
Now, here is the code I have inserted in this page :
and got this error :
Fatal error: Call to a member function update() on null in /home/my_site/wpupdate.php on line 15 (line 15 is the line with the update function)
It is just a PHP file at a URL that happens to be in the directory where you have WordPress installed, but you accessing that file directly and WordPress is not invoked.
Try using the plugin Code Snippets. You can add PHP snippets to it and it recently added the ability to run some code just once, for cases like this where you need to update something in the database on a one time basis.
I understand. In fact, I dont need to use a page as the aim is to test a function before placing it into a cred_save_data
What would be the best way to manage this test without managing a full page for this?
Use Code Snippets and run your code one time only, to test the function so that you can inspect the database and see whether it was updated as you expect.