mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- 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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user