/** * FLUSH THE REWRITES: */ function flush_rewrites() { //if we're in the admin: if (is_admin()) { $rewrites = $this->rewrite_list; $rewritestring = ''; //create the rewrite string: if (!empty($rewrites)) { foreach ($rewrites as $slug => $rewrite) { $rewritestring .= '|' . $slug . '|'; } } //check if there are new redirects: $redirects = get_cuisine_setting('rewrites'); if (empty($redirects) || $redirects != $rewritestring) { //then flush the rewrite rules: global $wp_rewrite; $wp_rewrite->flush_rules(); //and update the redirects options: update_cuisine_setting('rewrites', $rewritestring); } } }
/** * Show the options page: * * @access public * @return void */ function cuisine_option_page() { global $cuisine; //include the options page: require_once 'cuisine-admin-options.php'; //handle the saving of the options: if (isset($_POST[$cuisine->plugins->get_nonce_name()])) { $values = cuisine_sanitize_options(); update_cuisine_setting('simple_view', $values); cuisine_options_saved(); } cuisine_show_options_page(); }