- removed 'um_flush_stop' hidden option;

- removed every page rewrite rules action issue;
- added maybe_flush_rewrites function on wp_loaded hook;
This commit is contained in:
nikitasinelnikov
2019-10-24 01:01:04 +03:00
parent 78c53bb85a
commit 88ba816fc8
5 changed files with 77 additions and 84 deletions
+9 -6
View File
@@ -1,14 +1,16 @@
<?php
namespace um\core;
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\core\Setup' ) ) {
/**
* Class Setup
*
* @package um\core
*/
class Setup {
@@ -18,7 +20,6 @@ if ( ! class_exists( 'um\core\Setup' ) ) {
* Setup constructor.
*/
function __construct() {
//add_action('init', array(&$this, 'install_basics'), 9);
}
@@ -28,7 +29,6 @@ if ( ! class_exists( 'um\core\Setup' ) ) {
function run_setup() {
$this->install_basics();
$this->install_default_forms();
//$this->install_default_pages();
$this->set_default_settings();
$this->set_default_role_meta();
}
@@ -210,6 +210,9 @@ if ( ! class_exists( 'um\core\Setup' ) ) {
}
update_option( 'um_options', $options );
// reset rewrite rules after first install of core pages
UM()->rewrite()->reset_rules();
}
@@ -217,13 +220,13 @@ if ( ! class_exists( 'um\core\Setup' ) ) {
* Set default UM settings
*/
function set_default_settings() {
$options = get_option( 'um_options' );
$options = empty( $options ) ? array() : $options;
$options = get_option( 'um_options', array() );
foreach ( UM()->config()->settings_defaults as $key => $value ) {
//set new options to default
if ( ! isset( $options[ $key ] ) )
if ( ! isset( $options[ $key ] ) ) {
$options[ $key ] = $value;
}
}
update_option( 'um_options', $options );