예제 #1
0
        } else {
            $return = array();
        }
        die(json_encode($return));
    }
    /**
     * Save plugin options.
     *
     * Saves the plugin options based on context.  If no context is provided, updates all options.
     *
     * @since 5.0.0
     * @access static
     *
     * @param array  $options Associative array of plugin options.
     * @param string $context Array key of which options to update
     */
    public static function update_options($options = array(), $context = '')
    {
        $options_to_save = self::get_options();
        if (!empty($context) && is_string($context)) {
            $options_to_save[$context] = $options;
        } else {
            $options_to_save = $options;
        }
        self::$options = $options_to_save;
        update_site_option('MPSUM', $options_to_save);
    }
}
//end class MPSUM_Updates_Manager
MPSUM_Updates_Manager::get_instance();