OOP Framework and update_options not working
-
Hi folks,
I’m using an OOP framework into which I’ve shoe-horned the code from a plugin I’ve built. Problem is, the framework offers a means of updating plugin options and although I’m successfully requesting a response from a third party API, I can’t update the option ‘status’ of my plugin. Any thoughts on where I’m going wrong?
Here is the update function:
private function _admin_options_update() { // Verify submission for processing using wp_nonce if( wp_verify_nonce( $_REQUEST['_wpnonce'], "{$this->namespace}-update-options" ) ) { $data = array(); /** * Loop through each POSTed value and sanitize it to protect against malicious code. Please * note that rich text (or full HTML fields) should not be processed by this function and * dealt with directly. */ foreach( $_POST['data'] as $key => $val ) { $data[$key] = $this->_sanitize( $val ); } /** * Place your options processing and storage code here */ // Update the options value with the data submitted update_option( $this->option_name, $data ); // Redirect back to the options page with the message flag to show the saved message wp_safe_redirect( $_REQUEST['_wp_http_referer'] . '&update=1' ); exit; } }
I’m trying to run this function:
update_option( $WPBackitup->options['status'], $license_data->license );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘OOP Framework and update_options not working’ is closed to new replies.