rimpa

Code_Redirect to FPM

Apr 9th, 2016
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. if ( is_user_logged_in() ) {
  2. global $current_user;
  3. $user_roles = $current_user->roles;
  4. $user_role = array_shift($user_roles);
  5. if($user_role == 'dc_vendor' ) {
  6. $url = explode('?', 'http://'.$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
  7. $ID = url_to_postid($url[0]);
  8. $vendor_dashboard_page_id = get_option('wcmp_product_vendor_vendor_dashboard_page_id');
  9. if ($ID == $vendor_dashboard_page_id) {
  10. $vendor_product_page_id = get_option('wcmp_pending_products_page_id');
  11. $location = get_permalink($vendor_product_page_id);
  12. wp_safe_redirect ( $location);
  13. exit;
  14. }
  15. }
  16. }
Add Comment
Please, Sign In to add comment