Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'template_redirect', 'vendor_template_overrides');
- function vendor_template_overrides() {
- $pages = get_option("wcmp_pages_settings_name");
- if(!empty($pages)) {
- //rediect to admin dashboard
- if( is_user_logged_in() && is_vendor_page() && is_user_wcmp_vendor( get_current_user_id() ) ) {
- if(is_page($pages['vendor_dashboard']) && && !current_user_can('administrator')) {
- if ( function_exists('admin_url') ) {
- $adminurl = admin_url();
- } else {
- $adminurl = get_admin_url();
- }
- wp_safe_redirect( $adminurl );
- exit();
- }
- }
- }
- }
- function admin_vendor_shipping_redirect() {
- global $pagenow;
- if($pagenow == 'admin.php' && isset($_GET['page']) && $_GET['page'] == 'dc-vendor-shipping'){
- wp_redirect(site_url('/wcmp_vendor_shipping/', 'http'));
- exit;
- }
- }
- add_action('admin_init', 'admin_vendor_shipping_redirect');
Add Comment
Please, Sign In to add comment