/** * Reset permalink structure of the clone to default index.php/p=123 * This is used once * @global array $wpstg_options options */ function wpstg_reset_permalinks() { global $wp_rewrite; $permalink_structure = null; $already_executed = get_option('wpstg_rmpermalinks_executed') ? get_option('wpstg_rmpermalinks_executed') : 'false'; if (wpstg_is_staging_site() && $already_executed !== 'true') { $wp_rewrite->set_permalink_structure($permalink_structure); flush_rewrite_rules(); update_option('wpstg_rmpermalinks_executed', 'true'); } }
/** * Load Scripts on staging site * * Enqueues the required staging scripts on all staging sites including administration dashboard * * @since 1.0.3 * @global $post * @return void */ function wpstg_load_staging_styles() { global $wpstg_options; $css_dir = WPSTG_PLUGIN_URL . 'assets/css/'; $suffix = isset($wpstg_options['debug_mode']) ? '.min' : ''; $url = $css_dir . 'wpstg-admin-bar' . $suffix . '.css'; if (wpstg_is_staging_site()) { // Load it on all pages wp_register_style('wpstg-admin-bar', $url, array(), WPSTG_VERSION, 'all'); wp_enqueue_style('wpstg-admin-bar'); } }