Search
 
SCRIPT & CODE EXAMPLE
 

PHP

woocommerce redirect shop page

// Redirect WooCommerce Shop URL
function wpc_shop_url_redirect() {
    if( is_shop() ){
        wp_redirect( home_url( '/custom-page/' ) ); // Assign custom internal page here
        exit();
    }
}
add_action( 'template_redirect', 'wpc_shop_url_redirect' );
Comment

shop manager Redirect @ WooCommerce

add_filter( 'login_redirect', 'login_redirect_shop_manager_on_orders_list', 10, 3 );
function login_redirect_shop_manager_on_orders_list( $redirect_to, $request, $user ) {
    $defined_user_role = 'shop_manager'; // The defined user role

    if( isset($user->roles) && is_array($user->roles) && in_array( $defined_user_role, $user->roles ) ) {
        $redirect_to = admin_url('edit.php?post_type=shop_order'); // Custom redirection url

        wp_safe_redirect( $redirect_to ); // Force redirection
        exit(); // Mandatory to avoid errors
    }
    return $redirect_to;
}
Comment

PREVIOUS NEXT
Code Example
Php :: when WYSIWYG fields remove paragraph tag 
Php :: laravel import csv files 
Php :: current Menu Item 
Php :: PHP DOMDocument, Unicode problems 
Php :: run multiple php scripts parallel 
Php :: laravel collection min 
Php :: how to disable html coding property in php 
Php :: set owner symfony 
Php :: php map array key to variable names 
Php :: composer require laravelcollection 
Php :: how to follow unfollow on buddypress ajax call 
Php :: CURLAUTH_BEARER cannot find 
Php :: How to display limited post content in WordPress 
Php :: symfony create form multiple entities 
Php :: GZIP COMPRESSION With PHP 
Php :: composer new project laravel acl 
Php :: php count word arabic 
Php :: select next occurrence phpstorm 
Php :: php int to indonesian rupiah 
Php :: wordpress wpdb delete 
Php :: spatie media library 
Php :: php get current date 
Php :: laravel validation 
Php :: codeigniter select for update 
Php :: laravel create custom artisan command 
Php :: addphp calculate next letter 
Java :: java create window 
Java :: spring boot maven run with profile 
Java :: bootstrap center text vertically 
Java :: Cannot resolve class android.support.design.widget.AppBarLayout 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =