Skip to content

Instantly share code, notes, and snippets.

@ibrahim-kardi
Created March 3, 2022 15:40
Show Gist options
  • Save ibrahim-kardi/2228a543c7c6642ae76b0596e20d848a to your computer and use it in GitHub Desktop.
Save ibrahim-kardi/2228a543c7c6642ae76b0596e20d848a to your computer and use it in GitHub Desktop.
use this [login_lms]
add_shortcode( 'login_lms', 'lms_shortcode' );
function lmscodes_init(){
function lms_shortcode() {
if(tutils()->get_option('disable_tutor_native_login')) {
// Refer to login oage
header('Location: '.wp_login_url($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']));
exit;
}
?>
<div <?php tutor_post_class('tutor-page-wrap'); ?>>
<div class="tutor-template-segment tutor-login-wrap">
<div class="tutor-login-title">
<h4><?php _e('Please Sign-In to view this section', 'tutor'); ?></h4>
</div>
<div class="tutor-template-login-form">
<?php tutor_load_template( 'global.login' ); ?>
</div>
</div>
</div><!-- .wrap -->
<?php
}
}
add_action('init', 'lmscodes_init');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment