Jetpack::get_option_names PHP Method

get_option_names() public static method

* Jetpack Options API
public static get_option_names ( $type = 'compact' )
    public static function get_option_names($type = 'compact')
    {
        return Jetpack_Options::get_option_names($type);
    }

Usage Example

 /**
  * Deletes the given option.  May be passed multiple option names as an array.
  * Updates jetpack_options and/or deletes jetpack_$name as appropriate.
  *
  * @param string|array $names
  */
 function delete_option($names)
 {
     $names = (array) $names;
     foreach (array_diff($names, Jetpack::get_option_names(), Jetpack::get_option_names('non_compact')) as $unknown_name) {
         trigger_error(sprintf('Invalid Jetpack option name: %s', $unknown_name), E_USER_WARNING);
     }
     foreach (array_intersect($names, Jetpack::get_option_names('non_compact')) as $name) {
         delete_option("jetpack_{$name}");
     }
     $options = get_option('jetpack_options');
     if (!is_array($options)) {
         $options = array();
     }
     $to_delete = array_intersect($names, Jetpack::get_option_names(), array_keys($options));
     if ($to_delete) {
         foreach ($to_delete as $name) {
             unset($options[$name]);
         }
         return update_option('jetpack_options', $options);
     }
     return true;
 }
All Usage Examples Of Jetpack::get_option_names
Jetpack