function template_redirect() { global $cp_options; // if not logged in, redirect to login page //appthemes_auth_redirect_login(); // this is needed for IE to work with the go back button header("Cache-control: private"); global $current_user; if ($current_user->roles[0] != 'administrator') { cp_redirect_membership(); } //cp_redirect_membership(); // redirect to dashboard if can't renew if (isset($_GET['renew'])) { CP_Add_New::can_renew_ad(); } // needed for image uploading and deleting to work require_once ABSPATH . 'wp-admin/includes/file.php'; require_once ABSPATH . 'wp-admin/includes/image.php'; // include all the functions needed for this form require_once get_template_directory() . '/includes/forms/step-functions.php'; // load up the validate and tinymce scripts add_action('wp_enqueue_scripts', 'cp_load_form_scripts'); // load app-plupload scripts if (isset($_POST['cat']) && !isset($_POST['step1']) && $cp_options->ad_images && appthemes_plupload_is_enabled()) { add_action('wp_enqueue_scripts', 'appthemes_plupload_enqueue_scripts'); } }
function template_redirect() { // if not logged in, redirect to login page auth_redirect_login(); // this is needed for IE to work with the go back button header("Cache-control: private"); // if not meet membership requirement, redirect to membership purchase page cp_redirect_membership(); // redirect to dashboard if can't renew if (isset($_GET['renew'])) { CP_Add_New::can_renew_ad(); } // needed for image uploading and deleting to work include_once ABSPATH . 'wp-admin/includes/file.php'; include_once ABSPATH . 'wp-admin/includes/image.php'; // include all the functions needed for this form include_once TEMPLATEPATH . '/includes/forms/step-functions.php'; // load up the validate and tinymce scripts add_action('wp_print_scripts', 'cp_load_form_scripts'); //load ajax child categories scripts add_action('wp_head', 'cp_ajax_addnew_js_header'); // load app-plupload scripts if (isset($_POST['cat']) && !isset($_POST['step1']) && get_option('cp_ad_images') == 'yes' && appthemes_plupload_is_enabled()) { add_action('wp_print_scripts', 'appthemes_plupload_enqueue_scripts'); } add_action('appthemes_notices', array($this, 'show_notice')); }