function s4w_options_init() { $method = $_POST['method']; if ($method === "load") { $type = $_POST['type']; $prev = $_POST['prev']; if ($type) { s4w_load_all_posts($prev, $type); exit; } else { return; } } register_setting('s4w-options-group', 'plugin_s4w_settings', 's4w_sanitise_options'); }
function s4w_options_init() { if (!isset($_GET['page'])) { return; } if ('solr-for-wordpress/solr-for-wordpress.php' != $_GET['page'] || 'solr-for-wordpress%2Fsolr-for-wordpress.php' != $_GET['page']) { return; } $method = $_POST['method']; if ($method === "load") { $type = $_POST['type']; $prev = $_POST['prev']; if ($type) { s4w_load_all_posts($prev, $type); exit; } else { return; } } register_setting('s4w-options-group', 'plugin_s4w_settings', 's4w_sanitise_options'); }