title: WordPress get_option sometimes returning empty string even though option is saved
body: <p>I'm developing a WooCommerce payment gateway and I'm using <code>get_option</code> to retrieve user-defined options. One of the options the user can specify is the name of the payment method as it appears on the checkout page. In WooCommerce, there's a method for that named <code>getMethodTitle()</code>, which is supposed to return this.</p>
  
  <p>Mine looks like this:</p>
  
  <pre><code>public function getMethodTitle()
  {
      $title = $this-&gt;get_option($this-&gt;getMethodId() . '_title');
  
      if (is_null($title) || $title === '')
      {
          return __('My Default Value', My_Plugin_Class::PLUGIN_ID);
      }
  
      return __($title, My_Plugin_Class::PLUGIN_ID);
  }
  </code></pre>
  
  <p>Now, <code>$this-&gt;get_option($this-&gt;getMethodId() . '_title');</code> always returns <code>''</code> for some reason, even though this value is definitely saved in the database.</p>
  
  <p>In another WooCommerce method, <code>process_payment</code>, it works fine though. If I use <code>var_dump($this-&gt;get_option($this-&gt;getMethodId() . '_title'));</code>, I get the correct value just fine. </p>
  
  <p>Does anyone know why? Thanks!</p>
  
  <p>EDIT: Upon request, some extra information about the class and how it's initialized. My plugin adds not one, but (currently) 4 payment gateways to WooCommerce, so all my gateway classes are extended from another class that has global functionality, which in turn is also extended from yet another class. Basically:</p>
  
  <p><code>My_Payment_Gateway extends My_Payment_Gateway_With_Webhook extends My_Abstract_Payment_Gateway extends WC_Payment_Gateway</code>.</p>
  
  <p>Constructors are like so:</p>
  
  <pre><code>class My_Payment_Gateway extends My_Payment_Gateway_With_Webhook
  {
      public function __construct()
      {
          $this-&gt;supports = array(
              'products',
              'refunds'
          );
  
          $this-&gt;has_fields = true;
          $this-&gt;icon = false;
          $this-&gt;title = $this-&gt;getMethodTitle();
  
          parent::__construct();
      }
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>class My_Payment_Gateway_With_Webhook extends My_Abstract_Payment_Gateway
  {
      public function __construct()
      {
          parent::__construct();
  
          add_action('woocommerce_api_'.strtolower('My_Payment_Gateway_With_Webhook'), array($this, 'webhook'));
      }
  </code></pre>
  
  <p>And finally:</p>
  
  <pre><code>abstract class My_Abstract_Payment_Gateway extends WC_Payment_Gateway
  {
      const PLUGIN_FOLDER_NAME = "xxxxxxxxxxx";
  
      const STATUS_PENDING    = 'pending';
      const STATUS_PROCESSING = 'processing';
      const STATUS_ON_HOLD    = 'on-hold';
      const STATUS_COMPLETED  = 'completed';
      const STATUS_CANCELLED  = 'cancelled';
      const STATUS_REFUNDED   = 'refunded';
      const STATUS_FAILED     = 'failed';
  
      public function __construct()
      {
          $this-&gt;plugin_id = '';
          $this-&gt;id = strtolower(get_class($this));
          $this-&gt;method_title = $this-&gt;getMethodTitle();
          $this-&gt;method_description = $this-&gt;getMethodDescription();
          $this-&gt;init_form_fields();
          $this-&gt;init_settings();
  
          $this-&gt;apiClient = new Client(My_Base_Plugin_class::getApiKey(), My_Base_Plugin_class::isSandboxEnabled());
  
          $this-&gt;enabled = $this-&gt;get_option($this-&gt;getMethodId().'_'.'enabled');
          if (!$this-&gt;is_available())
          {
              $this-&gt;enabled = false;
          }
  
          add_action('woocommerce_api_' . $this-&gt;id, array($this, 'webhookAction'));
  
          $this-&gt;accountFieldInit();
  
          if (is_admin())
          {
              add_action('woocommerce_update_options_payment_gateways_' . $this-&gt;id, array($this, 'process_admin_options'));
          }
      }
  </code></pre>
  
  <p>The gateways are initialized as follows: the <code>My_Main_Plugin_Class</code> has a static class array called <code>$GATEWAYS</code> and a filter:</p>
  
  <pre><code>// Add payment gateways
  add_filter('woocommerce_payment_gateways', array(__CLASS__, 'addGateways'));
  </code></pre>
  
  <p>And finally the <code>addGateways</code> method:</p>
  
  <pre><code>public function addGateways(array $gateways)
  {
      return array_merge($gateways, self::$GATEWAYS);
  }
  </code></pre>