Example #1
0
function op_footer()
{
    do_action('op_footer');
    //Init the scripts array
    $js_scripts = array('tooltipster.min.js', 'selectnav.min.js', 'dropkick.js', 'jquery/jquery-ui-1.10.3.custom.min.js', 'jquery/jquery.sharrre-1.3.4.min.js', 'jquery/jquery.reveal.js', 'jquery/countdown.js', 'global.js');
    //Init the frontend array, which will then be converted to JSON
    if (!is_admin()) {
        op_localize_script('front');
        wp_enqueue_script('op-menus', OP_JS . 'menus.js', array());
    }
    //Print out script include
    foreach ($js_scripts as $script) {
        echo '<script type="text/javascript" src="' . OP_JS . $script . '"></script>';
    }
    //Print out footer scripts
    op_print_footer_scripts('front');
    wp_footer();
    //Return (which will not allow user in), if the user does not have permissions
    if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {
        return;
    }
    if (!get_user_option('rich_editing')) {
        return;
    }
    //If we are previewing, run the following script
    $preview = !empty($_GET['preview']) ? $_GET['preview'] : false;
    echo $preview ? '
		<script type="text/javascript">
			jQuery(\'#TB_window\', window.parent.document).css({marginLeft: \'-\' + parseInt((1050 / 2),10) + \'px\',width:\'1050px\',height:\'600px\'});
			jQuery(\'#TB_iframeContent\', window.parent.document).css({width:\'1050px\',height:\'600px\'});
		</script>
	' : '';
    //Insert tracking scripts
    $tracking = op_default_option('analytics_and_tracking');
    echo !empty($tracking['google_analytics_tracking_code']) ? stripslashes($tracking['google_analytics_tracking_code']) : '';
    echo !empty($tracking['sitewide_tracking_code']) ? stripslashes($tracking['sitewide_tracking_code']) : '';
}
Example #2
0
 function print_footer_scripts()
 {
     op_localize_script('admin');
 }