Add custom views options I am trying to add some custom view options. I am not even sure if what I'm trying to do is possible.

Basically I want to put a custom option under the Other category.

It would look like:

My custom options: disabled

When the user clicks on "disabled", it should show a custom form where the user can set some settings for that view. 

I have looked into this, but couldn't find anything that would let me add custom options here.
What you're actually looking to do is to implement a custom Views Display Extender plugin (https://api.drupal.org/api/views/views.api.php/group/views_plugins/7.x-3.x).

It's not particularly trivial and I got most of my information from this wonderful tutorial here: How to write a Views Plugin Display Extender (D7) by Bryan Ollendyke

Here's a basic outline:

-create a custom module (let's call it mymodule) and implement hook_views_api().

/**
 * Implements hook_views_api().
 */
function mymodule_views_api() {
  return array(
    'api' =&gt; 3,
    'path' =&gt; drupal_get_path('module', 'mymodule'),
  );
}


-Create a mymodule.views.inc file (remembering to add the file to your mymodule.info file) and implement hook_views_plugins(). It should look something like this:

/**
* Implements hook_views_plugins().
 */
function mymodule_views_plugins() {
  $path = drupal_get_path('module', 'my_module');
  $plugins = array();

  $plugins['display_extender'] = array(
    'mymodule' =&gt; array(
      'title' =&gt; t('Some Setting'),
      'help' =&gt; t('A description of the setting.'),
      'path' =&gt; $path,
      'handler' =&gt; 'mymodule_views_plugin_display_extender',
    ),
  );

  return $plugins;
}


-Note the "handler" index in the above array. You'll need to implement that in a file called mymodule_views_plugin_display_extender.inc (again, remembering to add that in your mymodule.info file). The implementation should look something like this:

class mymodule_views_plugin_display_extender extends views_plugin_display_extender {
  /**
   * Provide a form to edit options for this plugin.
   */
  function options_definition_alter(&amp;$options) {
    $options['my_setting'] = array(
      'default' =&gt; 0,
    );
  }

  /**
   * Provide a form to edit options for this plugin.
   */
  function options_form(&amp;$form, &amp;$form_state) {
      parent::options_form($form, $form_state);

      if ($form_state['section'] === 'mymodule') {
        $form['my_setting'] = array(
          '#type' =&gt; 'checkbox',
          '#title' =&gt; t('Some Setting'),
          '#description' =&gt; t('A sample checkbox.'),
          '#default_value' =&gt; $this-&gt;display-&gt;get_option('my_setting'),
        );
      }
  }

  /**
   * Handle any special handling on the validate form.
   */
  function options_submit(&amp;$form, &amp;$form_state) {
    $this-&gt;display-&gt;set_option('my_setting', $form_state['values']['my_setting']);
  }

  /**
   * Provide the default summary for options in the views UI.
   *
   * This output is returned as an array.
   */
  function options_summary(&amp;$categories, &amp;$options) {
    $options['mymodule'] = array(
      'category' =&gt; 'other',
      'title' =&gt; t('Some Setting'),
      'value' =&gt; ($this-&gt;display-&gt;get_option('my_setting')) ? 'Yes' : 'No',
      'desc' =&gt; t('Set a setting.'),
    );
  }

}


After all that your mymodule.info file should look something like this:

name = My Module
description = Sample views display extender
core = 7.x
version = 7.x-1.0

dependencies[] = views

files[] = mymodule.views.inc
files[] = mymodule_views_plugin_display_extender.inc


If that all works out, you should see a setting show up under "Other" (you can change that using the 'category' in the options_summary implementation in mymodule_views_plugin_display_extender.inc.

After that, in your module, you can access the option from the view using something like:

$view-&gt;display_handler-&gt;get_option('my_setting');


For instance, if you were implementing `hook_views_post_execute().

/**
 * Implements hook_views_post_execute().
 */
function mymodule_views_post_execute(&amp;$view) {
  $my_setting = $view-&gt;display_handler-&gt;get_option('my_setting');
}