title: option_value is empty when i'm submitting the form - Wordpress custom settings page
body: <p>The context is as follows: We are on WAMPSERVER so locally. I want to create an options page for my own plugin. I followed several tutorials and I created this small and simple test:
  <a href="https://i.stack.imgur.com/aO8RD.png" rel="nofollow noreferrer">The settings page</a></p>
  <p>For the moment, everything is fine.
  But here is the problem, in the 'wp_options' table in the Wordpress database, I see my variable but the 'option_value' column is empty after my submit.
  Example : In my field I put 'test_value', I press the submit button, I should see it in the 'option_value' column of 'my_var'.</p>
  <p>But here is the result of my submit on my database in phpMyAdmin :
  <a href="https://i.stack.imgur.com/rqjUN.png" rel="nofollow noreferrer">the result</a></p>
  <p>Here is the code for this test:</p>
  <pre class="lang-php prettyprint-override"><code>add_action('admin_init', 'register_fields_opac');
  function register_fields_opac() {
      register_setting('var_id', 'my_var', 'sanitize_text_field');
      add_settings_section('section_id', '', '', 'the_option_page_slug');
      add_settings_field('field_id', 'field_name', 'var_test', 'the_option_page_slug', 'section_id');
  }
  
  function var_test() {
      $test = get_option('field_id');
      
      printf( 
          '&lt;input type=&quot;text&quot; id=&quot;field_id&quot; size=&quot;75&quot; value=&quot;%s&quot;/&gt;'
          , $test    
      );
  }
  
  
  function display_options() {
      echo '&lt;div class=&quot;wrap&quot;&gt;
          &lt;h1&gt; Test &lt;/h1&gt;
  
          &lt;form action=&quot;options.php&quot; method=&quot;post&quot;&gt;';
          
      settings_fields('var_id');
      
      do_settings_sections('the_option_page_slug');
      
      echo '&lt;input type=&quot;submit&quot;/&gt;';
      
      echo '&lt;/form&gt;&lt;/div&gt;';
  }
  </code></pre>
  <p>What is the problem? Can we also change the 'autoload' variable with a function similar to 'register_settings' instead of 'update_option'?</p>
  <p>Information about me:
  I'm a beginner on Wordpress (and stackOverflow), this is my first assignment on a CMS. If you need more information, don't hesitate to tell me.</p>
  <ol>
  <li>PHP version : 7.4.9</li>
  <li>Wordpress : 5.8.2 french version</li>
  <li>MySQL version : 5.7.31</li>
  <li>PhpMyAdmin : 5.0.2</li>
  </ol>