CodeExplorer save_key example
$new_key =
preg_replace( '/[^a-f0-9]/i', '',
$_POST['key'
] );
$old_key = Akismet::
get_api_key();
if ( empty( $new_key ) ) { if ( !
empty( $old_key ) ) { delete_option( 'wordpress_api_key'
);
self::
$notices[] = 'new-key-empty';
} } elseif ( $new_key !=
$old_key ) { self::
save_key( $new_key );
} return true;
} public static function save_key( $api_key ) { $key_status = Akismet::
verify_key( $api_key );
if ( $key_status == 'valid'
) { $akismet_user = self::
get_akismet_user( $api_key );