/** * Populates the default values of the plugins settings to the database or the current site. */ private static function populate_default_settings() { $settings = new \html_import\admin\HtmlImportSettings(); if (!get_option($settings::SETTINGS_NAME)) { $settings->saveToDB(); } }
* @package HTMLImportPlugin * @author Patrick Mauro <*****@*****.**> * @license GPL-2.0+ * @link http://patrick.mauro.ca * @copyright 2014 Patrick Mauro */ /* * Processing for form submission */ if (isset($_POST['action']) && 'save' == $_POST['action']) { if (isset($_POST['submit'])) { $settingsToProcess = new html_import\admin\HtmlImportSettings(); $settingsToProcess->loadFromDB(); //loads the defaults in case not all settings are passed in the POST $settingsToProcess->loadFromPOST(); $settingsToProcess->saveToDB(); ?> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script> $(document).ready(function () { $('#noLogMessages').click(function () { $('#noLogMessages').hide('fast'); $('#logMessages').show('fast'); }); $('#logMessages').click(function () { $('#noLogMessages').show('fast'); $('#logMessages').hide('fast'); }); }); </script>