Non Object Error in Wordpress
The updater scriipt works properly when included in a Wordpress page or post template, but not when included in a script run by a form action from the plugin. (action="script.php")
This is the error:
fatal error call to a member function query on a non-object ... |
global $wpdb; $table_name = $wpdb->prefix . "my_table_name"; $sql = "TRUNCATE " . $table_name; $result = $wpdb->query($wpdb->prepare($sql));
What is the correct way of getting the Wordpress functions, and framework, etc., loaded in this small script?
Many thanks for your consideration and help!
Kirk
HTML/CSS/jQuery/ZURB Foundation/Twitter Bootstrap/Wordpress/Frontend Performance Optimizing
---
Need HTML/CSS help? Skype: microcosmic - Test Your Responsive Design - InternetCookies.eu
Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)
Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)