Hi asimjaved,
You’ll need to do two things. First, edit an-gradebook/GradeBook.php. Place the code below at the end of the file just before ?>
.
function an_gradebook_shortcode (){
init_an_gradebook();
$an_gradebook_develop = true;
$app_base = plugins_url('js',__FILE__);
wp_register_script( 'init_front_end_gradebookjs', $app_base.'/../init_front_end_gradebook.js', array('jquery'), null, true);
wp_enqueue_script('init_front_end_gradebookjs');
if( 1==1){
wp_register_style( 'jquery_ui_css', $app_base.'/lib/jquery-ui/jquery-ui.css', array(), null, false );
wp_register_style( 'GradeBook_css', plugins_url('GradeBook.css',__File__), array('bootstrap_css','jquery_ui_css'), null, false );
wp_register_style( 'bootstrap_css', $app_base.'/lib/bootstrap/css/bootstrap.css', array(), null, false);
wp_register_script( 'requirejs', $app_base.'/require.js', array(), null, true);
wp_enqueue_style('GradeBook_css');
wp_enqueue_script('requirejs');
wp_localize_script( 'requirejs', 'require', array(
'baseUrl' => $app_base,
'deps' => array( $app_base . ($an_gradebook_develop ? '/an-gradebook-app.js' : '/an-gradebook-app-min.js')
)));
} else {
return;
}
return '<div id="wpbody-content"></div>';
}
add_shortcode('an_gradebook', 'an_gradebook_shortcode');
Second, add a new file under the an-gradebook directory named init_front_end_gradebook.js and inside this file insert the code below.
(function($){
var _x = window.location.href + "#courses";
window.location.href = _x;
})(jQuery);
Also, you will likely want to change the value of $an_gradebook_develop to false. This will shorten the load time of the page.
Let me know how this turns out.
Regards,
Aori Nevo