From: Laury GvR Date: Wed, 4 Mar 2015 15:21:30 +0000 (-0500) Subject: Un-fixing ajax calls, removing redirect from wp-admin for non-subscribers X-Git-Tag: v1.0.0^2~8 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=68e7a03a0ba35e0c9501baa4565526cc842aadec;p=WP-Themes%2FTomsMomsCookies.git Un-fixing ajax calls, removing redirect from wp-admin for non-subscribers --- diff --git a/functions.php b/functions.php index be8941e..bf97df3 100755 --- a/functions.php +++ b/functions.php @@ -128,55 +128,4 @@ add_filter( 'woocommerce_enqueue_styles', '__return_false' ); add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 48;' ), 20 ); -function redirect_user_on_role() -{ - if(!isset($_REQUEST['action']) && !current_user_can('publish_pages')): - do_action( 'wp_ajax_' . $_REQUEST['action'] ); - do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); - wp_redirect( home_url() ); exit; - endif; - if (!current_user_can('publish_pages') ) { - /* A non-admin, non-editor */ - } - //If login user role is Subscriber - // if ($current_user->user_level !== 0) - //If login user role is Contributor - // if ($current_user->user_level > 1) - //If login user role is Editor - // if ($current_user->user_level > 8) - -} -add_action('admin_init', 'redirect_user_on_role'); -add_action( 'wp_ajax_redirect_user_on_role', 'redirect_user_on_role' ); -add_action( 'wp_ajax_nopriv_redirect_user_on_role', 'redirect_user_on_role'); -?> - - - - - - - \ No newline at end of file +?> \ No newline at end of file