- optimized account page;

- optimized code of shortcodes/password/account classes;
- fixed some enqueue scripts issues;
This commit is contained in:
nikitozzzzzzz
2017-08-11 14:21:42 +03:00
parent 92ab044b8a
commit af191ee149
11 changed files with 695 additions and 803 deletions
+42
View File
@@ -176,6 +176,48 @@ if ( ! class_exists( 'UM_Functions' ) ) {
}
/*
* redirect
*/
function redirect( $url ) {
if ( headers_sent() || empty( $url ) ) {
$this->cc_js_redirect( $url );
} else {
wp_redirect( $url );
}
exit;
}
/*
* JS redirect
*/
function cc_js_redirect( $url ) {
//for blank redirects
if ( '' == $url ) {
$url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
}
$funtext="echo \"<script data-cfasync='false' type='text/javascript'>window.location = '" . $url . "'</script>\";";
register_shutdown_function( create_function( '', $funtext ) );
if ( 1 < ob_get_level() ) {
while ( ob_get_level() > 1 ) {
ob_end_clean();
}
}
?>
<script data-cfasync="false" type="text/javascript">
window.location = '<?php echo $url; ?>';
</script>
<?php
exit;
}
}
}