update_options をこの関数で動作させようとしています。基本的に、ユーザーはアクティベーション コードを入力し、プラグイン オプション ページから送信します。コードがサードパーティに送信され、成功した場合はステータスが返されます。これはすべて正常に機能しますが、問題のオプションのステータスを変更するための update_options を取得できません。
これが更新機能です(私が使用しているOOPフレームワークの一部です):
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;
}
}
私はこの機能を実行しようとしています:
update_option( $WPBackitup->options['status'], $license_data->license );